How to clear the system cache by centos6.2
This article focuses on "how to clear the system cache by centos6.2". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "centos6.2 how to clear the system cache"!
1. Use the free-m command to check memory usage
The code is as follows:
Total used free shared buffers cached
Mem: 3832 2716 1115 0 95 1483
-/ + buffers/cache: 1137 2695
Swap: 6015 0 6015
From the above, we can see that there are as many as 1483m of cache in memory. Fortunately, my memory is 4G, so if it is 2G, I can't stand it.
2. Use sync command to force the data stored in buffer to be written to the hard disk
3. Use the following command to clear the cache and free up space.
The code is as follows:
Echo 3 > / proc/sys/vm/drop_caches
4. Use the free-m command to check the memory usage
The code is as follows:
Total used free shared buffers cached
Mem: 3832 1176 2655 0 0 169
-/ + buffers/cache: 1006 2825
Swap: 6015 0 6015
OK, the above steps are fine. In fact, the final step is the third step. Sometimes the cache is extremely high after watching a movie or downloading a file under linux, but now it is solved.
At this point, I believe you have a deeper understanding of "how to clear the system cache by centos6.2". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!