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   -   Original Discussion by Neo
Neo's Unix or Linux Image
Neo Neo is online now Forum Staff  
Join Date: Sep 2000
Last Activity: 18 November 2017, 2:40 PM EST
Location: Asia pacific region
Posts: 13,904
Thanks: 898
Thanked 1,241 Times in 583 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 02:08 PM
how to get the more memory free space (see memory free column) murthy76 Solaris 3 04-21-2009 10:34 AM
How to find Total and Free Physical Memory and Logical Memory in SOLARIS 9 0ktalmagik Solaris 4 02-03-2009 09:37 AM
Linux Server free memory decreases Vaibhav Agarwal Linux 13 12-18-2008 10:15 AM
Determining free(available) memory in MV linux trancedeejay Programming 11 02-20-2006 04:56 AM

All times are GMT -4. The time now is 03:41 PM.