If it was a swap file, the type would have been file instead of partition. swapon -showĪs you can see, I have 14.9 GB of swap space and it’s on a separate partition. The swapon command is better in this regard. The free command gives you the size of the swap space but it doesn’t tell you if it’s a real swap partition or a swap file. Total used free shared buff/cache available In my case, my Dell XPS has 14GB of swap. You can check it with the free command in Linux. Check swap space in Linuxīefore you go and start adding swap space, it would be a good idea to check whether you have swap space already available in your system. Even if you don’t create a swap partition, Ubuntu creates a swap file of around 1 GB on its own. Recent versions of Ubuntu and some other Linux distributions have started using the swap file by default. But with swap files, you can resize them as you like. With dedicated swap partition, resizing the swap space is a nightmare and an impossible task in many cases. You create a file under root and tell your system to use it as the swap space. With swap file, you don’t need a separate partition anymore. But this trend has changed in the recent years. When you install Linux, you create a separate partition just for swap. Traditionally, swap space is used as a separate partition on the disk. I recommend reading this article to learn more about swap on Linux. When the RAM is free again, it swaps back the data from the disk. This frees up the RAM to serve more important processes. When your system starts running out of RAM, it uses the swap space to and swaps some content of the RAM on to the disk space. A swap file allows Linux to simulate the disk space as RAM.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |