Swappiness in Linux Explained

This article was dedicated to the concept of swappiness in Linux and how you can the default swappiness value according to your own requirements.

Ayesha Sajid Ayesha Sajid has secured a Bachelors degree in Computer Sciences and currently, she is doing her Masters in Information Security. She is a technical content writer by profession who has experience in working with Windows and the different flavours of Linux operating system.

Swappiness is a concept that helps the system’s RAM a lot in operating properly. Whenever the RAM runs out of memory, it swaps the inactive pages from itself to the swap memory so that more processes can be brought to RAM that need to be executed. In this article, we will quickly learn about the concept of swappiness in Linux.

What is Swappiness in Linux?

Swappiness is a property of the Linux kernel that defines how frequently your system makes use of the swap space or how often it swaps the inactive pages from RAM to the swap space. The swappiness value ranges from 0 to 100 and the default value of swappiness, for most of the Linux systems, is “60”. However, you can change this value according to your own requirements.

How to Check the Swappiness Value in Linux?

To check the swappiness value in Linux, you can execute the command that follows:

$ cat /proc/sys/vm/swappiness

The swappiness value of our Linux system is shown in the image below:

Conclusion

This article was dedicated to the concept of swappiness in Linux. After a quick explanation of this concept, we also shared with you the command with which you can easily check the swappiness value of your Linux system. Moreover, you can also change the default swappiness value in Linux according to your own requirements.

Written by

Ayesha Sajid

Ayesha Sajid has secured a Bachelors degree in Computer Sciences and currently, she is doing her Masters in Information Security. She is a technical content writer by profession who has experience in working with Windows and the different flavours of Linux operating system.

More Posts