How to Clear Swap Memory in Linux?
Contents How to Clear Ram Memory Cache, Buffer and Swap Space on Linux Clear Pagecache Only. # Sync; Echo 1 > /Proc/Sys/Vm/Drop_Caches. Clear Dentries and...
How to Clear RAM Memory Cache, Buffer and Swap Space on Linux
- Clear PageCache only. # sync; echo 1 > /proc/sys/vm/drop_caches.
- Clear dentries and inodes. # sync; echo 2 > /proc/sys/vm/drop_caches.
- Clear PageCache, dentries and inodes. # sync; echo 3 > /proc/sys/vm/drop_caches.
- sync will flush the file system buffer. Command Separated by “;” run sequentially.
What is swap memory in Linux?
Swap is a space on a disk that is used when the amount of physical RAM memory is full. Swap space can take the form of either a dedicated swap partition or a swap file. In most cases when running Linux on a virtual machine a swap partition is not present so our only option is to create a swap file.
Must Read
What happens when swap memory is full?
When the system needs more memory and the RAM is full, inactive pages in the memory will be moved to the swap space. Swap is not a replacement to physical memory, it is just a small portion on hard drive; it must be created during the installation.