Linux release cache memory tutorial

  

/proc is a virtual document system, we can communicate with it by means of a means of communication between the read and write operations and the kernel entity. That is to say, by modifying the document in /proc, The current kernel behavior is adjusted. Then we can free the memory by adjusting /proc/sys/vm/drop_caches. The operation is as follows: # cat /proc/sys/vm/drop_caches 0 First, /proc/sys/vm/drop_caches Value, default is 0 # sync Manually execute the sync command (Description: The sync command runs the sync subroutine. If the system must be stopped, run the sync command to ensure the integrity of the document system. The sync command writes any unwritten system buffers To disk, contains modified i-node, deferred block I/O, and read-write mapping document # echo 3 > /proc/sys/vm/drop_caches # cat /proc/sys/vm/drop_caches 3 will /The value of proc/sys/vm/drop_caches is set to 3

Then you can see that the memory of the cache is freed by using free. This is very useful when testing disk IO.

Copyright © Windows knowledge All Rights Reserved