There may be a time that you wish to clear a Memory on your server. Normally you do not want to fiddle with it so do it only you are sure that it is necessary and that it would not affect your server's performance. For this we can use sysctl command which allows linux admins to configure kernel parameters at runtime.

This command will clear pagecache:

/sbin/sysctl vm.drop_caches=1

To clear dentries and inodes you can use:

/sbin/sysctl vm.drop_caches=2

To free memory of the all above use a following command:

/sbin/sysctl vm.drop_caches=3

What the above commands will do is that they will sync your memory and edit a following file with appropriate number entry. :

/proc/sys/vm/drop_caches

Do not edit this file directly !

Use top utility to see whether you successfully freed your memory.

Free Linux eBooks

Do you have the right skills?

Our IT Skills Watch page reflects an up to date IT skills demand leaning towards the Linux and Unix environment. We have considered a number of skills and operating systems.

See the result...

Linux Online Training

Learn to run Linux servers and prepare for LPI certification with Linux Academy. 104 available video lessons with PDF course notes with your own server!

Go to top