How to release cache in linux [root @ master ~] Free-mtotalusedfreesharedbufferscachedMem: 20091999901308437 how to release cache in linux [root @ master ~] # Free-m total used free shared buffers cachedMem: 2009 1999 9 0 1308 437-/+ buffers/cache: 253 1756 5951 Swap: 5951 0 [root @ master ~] # Cat/proc/sys/vm/drop_caches 0 [root @ master ~] # Echo 3>/proc/sys/vm/drop_caches [root @ master ~] # Cat/proc/sys/vm/drop_caches 3 [root @ master ~] # Sync [root @ master ~] # Free-m total used free shared buffers cachedMem: 2009 463 1545 0 176 49-/+ buffers/cache: 236 1772 Swap: 5951 0 5951 the usage of/proc/sys/vm/drop_caches is described below/proc/sys/vm/drop_caches (since Linux 2.6.16) writing to this file causes the kernel to drop clean caches, dentries and inodes from memory, causing that memory to becomefree. to free pagecache, use echo 1>/proc/sys/vm/drop_caches; tofree dentries and inodes, use echo 2>/proc/sys/vm/drop_caches; to free pagecache, dentries and inodes, use echo 3>/proc/sys/vm/drop_caches. because this is a non-destructive operation and dirty objectsare not freeable, the user shocould run sync (8) first.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service