Free Linux Memory by Dropping Caches | Unix Linux Forums | Linux

  Go Back    


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

Free Linux Memory by Dropping Caches

Linux


Tags
drop_caches, linux, memory, proc filesystem

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-29-2008
Neo's Avatar
Neo Neo is online now Forum Staff  
Administrator
 
Join Date: Sep 2000
Last Activity: 28 July 2014, 12:03 PM EDT
Location: Asia pacific region
Posts: 13,002
Thanks: 515
Thanked 868 Times in 397 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:


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

To free dentries and inodes:


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

To free pagecache, dentries and inodes:

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

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 12:26 PM.