when reading and writing files, To improve read and write efficiency and speed, the Linux kernel caches files in memory, which is the cache memory.
cat/proc/sys/vm/drop_caches
0 Span style= "Font-family:arial;font-size:14px;line-height:26px;white-space:pre;background-color:rgb (255,255,255) ;" > //default is 0 ; 1-Empty page cache, 2-empty inode and directory tree cache, 3-empty all caches
Most GNU Linux is enabled by default caching mechanism, viewing the configuration file cat/proc/sys/vm/drop_caches if 0, it means that the caching mechanism is turned on, this mechanism is very effective when running a service, convenient for the service itself to read quickly, As a desktop user, the open program is not so single, so the desktop users are recommended to set this profile is 1, timely clean up the system cache, freeing up space for other programs to use.
[email protected] ~]#Sync//Note: Use the sync command to synchronize data to disk before emptying the cache
[email protected] ~]#free-m
Total used free shared buffersCached
mem:15898 3029 12869 0 1911064
-/+ buffers/cache:1772 14125
swap:31999 0 31999
[email protected] ~]#Echo 3>/proc/sys/vm/drop_caches
[email protected] ~]#free-m//Discovery cache significantly reduced
Total used free shared buffersCached
mem:15898 1770 14128 0 1 -
-/+ buffers/cache:1738 14160
swap:31999 0 31999
To clean up the cache script:
#! Bin/bash
Sync
Sync
Echo 3 >/proc/sys/vm/drop_caches
This article is from the "Dream to Reality" blog, please be sure to keep this source http://lookingdream.blog.51cto.com/5177800/1859445
CentOS, Cleanup cache (drop_caches)