1. First check the memory usage with the free tool:
This is my Linux always data
Mem: |
4046824 |
763620 |
3283204 |
9004 |
10284 |
61560 |
-/+buffers/cache: |
691776 |
3355048 |
|
|
|
|
Total |
Used |
Free |
Shared |
Buffers |
Cached |
Can see
To achieve the purpose of releasing the cache, we first need to understand the key configuration file/proc/sys/vm/drop_caches. This file records the parameters of the cache release, the default value is 0, which is not to release the cache. His value can be any number between 0~3, which represents a different meaning:
0– not release
-Free Page Cache
Release Dentries and Inodes
3– Release All Caches
Once we know the parameters, we can use the following instruction to operate according to our needs.
Use sync to store all the non-writable system buffers to disk, including modified I-node, deferred block I/O, and read-write mapping files to avoid losing data during cache release.
Linux system memory Full solution! ~