In the past few days, the CentOS system memory has been rising. even if apache and mysql are disabled, the memory will not be released. you can use the following script to release the memory :#! /Bin/bash # release cache:
In the past few days, the CentOS system memory has been increasing. even if apache and mysql are disabled, the memory will not be released. you can use the following script to release the memory:
Script content :#! /Bin/bash # cache release: # To free pagecache: sync # echo 1>/proc/sys/vm/drop_caches # To free dentries and inodes: # echo 2>/proc/sys/vm/drop_caches # To free pagecache, dentries and inodes: echo 3>/proc/sys/vm/drop_caches use the crontab system To run automatically every day: crontab-e: 00 00 ***/root/Cached. sh releases the memory at every day. you can modify the settings as needed during this time. /Cached. if an error occurs during sh: Permission denied Permission, run: chmod + x. cached. sh also You can modify/etc/sysctl. conf to automatically release the cache. However, if the memory is not enough, it is best to look for other reasons, such as whether the program is set properly, whether the traffic volume is too large, or whether the program design is unreasonable, leading to memory overflow, after all, the design of the operating system will consider all aspects of the problem, and force the size of the cache to free up, it may only temporarily block the problem, is not conducive to judging the problem.