Unix/Linux Go Back    

Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

Free Linux Memory by Dropping Caches


drop_caches, linux, memory, proc filesystem

Thread Tools Search this Thread Display Modes
Old Unix and Linux 11-29-2008
Neo's Unix or Linux Image
Neo Neo is online now Forum Staff  
Join Date: Sep 2000
Last Activity: 28 October 2016, 4:17 AM EDT
Location: Asia pacific region
Posts: 13,426
Thanks: 811
Thanked 1,057 Times in 496 Posts
Free Linux Memory by Dropping Caches

Linux Kernels 2.6.16 and up provide a way to instruct the kernel to drop the page cache, inode and dentry caches on command. This tip can help free Linux memory without a reboot.

Note: This is a non-destructive operation. Dirty objects are not freeable, hence; you must run sync beforehand.

To use /proc/sys/vm/drop_caches, you simply echo a number to it.

To free pagecache:

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

To free dentries and inodes:

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

To free pagecache, dentries and inodes:

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

Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
free memory in debian linux lhareigh890 UNIX for Advanced & Expert Users 1 07-01-2011 01:08 PM
how to get the more memory free space (see memory free column) murthy76 Solaris 3 04-21-2009 09:34 AM
How to find Total and Free Physical Memory and Logical Memory in SOLARIS 9 0ktalmagik Solaris 4 02-03-2009 08:37 AM
Linux Server free memory decreases Vaibhav Agarwal Linux 13 12-18-2008 09:15 AM
Determining free(available) memory in MV linux trancedeejay Programming 11 02-20-2006 03:56 AM

All times are GMT -4. The time now is 04:20 AM.