Linux how clean the cache to clear the cache of linux command

linux command to clear the cache

 

View cache command

  free -m

Clean the cache command 

     echo 1 > /proc/sys/vm/drop_caches

          echo 2 > /proc/sys/vm/drop_caches

          echo 3 > /proc/sys/vm/drop_caches

echo 0 is not releasing cached

echo 1 is released page cache

ehco 2 is released dentries and inodes Cache

echo 3 is to release all the cache 1 and 2 of the said

 

Description:
.. 1> / proc is a virtual file system, a means we can read and write operations for communicating over inter-entity as a kernel of it. That you can modify files in / proc, to make adjustments to the current behavior of the kernel. That we can release memory by adjusting the / proc / sys / vm / drop_caches .
0 - do not release
1-- released page cache
2 - release dentries and inodes
3 - Release all caches
The number 1 is used to empty recently asked to put the file page cache
Number 2 is used to clear the file cache nodes and cache directory entry
Figures 1 and 3 is used to empty all contents of buffer 2.
2> The official description of the drop_caches as follows:
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;
to free  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 objects are not freeable, the user should run sync first.
 
Resources from the source to: https://www.cnblogs.com/zhehan/p/10716612.html

View cache command

  free -m

Clean the cache command 

     echo 1 > /proc/sys/vm/drop_caches

          echo 2 > /proc/sys/vm/drop_caches

          echo 3 > /proc/sys/vm/drop_caches

echo 0 is not releasing cached

echo 1 is released page cache

ehco 2 is released dentries and inodes Cache

echo 3 is to release all the cache 1 and 2 of the said

 

Description:
.. 1> / proc is a virtual file system, a means we can read and write operations for communicating over inter-entity as a kernel of it. That you can modify files in / proc, to make adjustments to the current behavior of the kernel. That we can release memory by adjusting the / proc / sys / vm / drop_caches .
0 - do not release
1-- released page cache
2 - release dentries and inodes
3 - Release all caches
The number 1 is used to empty recently asked to put the file page cache
Number 2 is used to clear the file cache nodes and cache directory entry
Figures 1 and 3 is used to empty all contents of buffer 2.
2> The official description of the drop_caches as follows:
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;
to free  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 objects are not freeable, the user should run sync first.

Guess you like

Origin www.cnblogs.com/6zdk/p/12063884.html