Tuesday, August 18, 2015

Simple way to clear the cache memory in Linux

Although linux has an efficient memory management, sometimes the cache memory grows so much that it uses almost all your memory.

Mem:   8176884k total,  7542820k used,   634064k free,    16672k buffers
Swap:  3905460k total,        0k used,  3905460k free,  6935016k cached

You can force the system to clear it using the following command:

# sync; echo 3 > /proc/sys/vm/drop_caches

Note: sync flushes the file system buffers

After doing it, you’ll see that there’s more free memory in your system:

Mem:   8176884k total,   254456k used,  7922428k free,    32328k buffers
Swap:  3905460k total,        0k used,  3905460k free,    91500k cached

Reference:

http://sysadmin.carlusgg.com/?p=366

No comments: