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

Linux


Tags
drop_caches, linux, memory, proc filesystem

Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 11-29-2008
Neo's Unix or Linux Image
Neo Neo is offline Forum Staff  
Administrator
 
Join Date: Sep 2000
Last Activity: 3 July 2015, 4:06 PM EDT
Location: Asia pacific region
Posts: 13,160
Thanks: 658
Thanked 977 Times in 448 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 Linux or Unix Question

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 11:23 PM.