Release Ubuntu/linux system cache to increase available memory space
Source: Internet
Author: User
A desktop Ubuntu memory total 4G, but free memory only 100M
Note Use the top command to see the true free memory. Here's another command to see how much memory is actually used.
Watch-n 1 Cat/proc/meminfo
Search found that there are three ways to achieve the purpose of freeing memory.
Watch-n 1 free-m
Or
Free-m
The above method only increased by dozens of M.
sudo sysctl-w vm.drop_caches=3
The purpose of this method is to release the memory that kernel uses on the cache. increased by about 1G.
The following method releases more, but may affect the stability of the system! Be sure to use it carefully.
sudo sync && echo 3 | sudo tee/proc/sys/vm/drop_caches
This command releases either the memory in use or the cache (page cache, inodes, and Dentries), which is used with care.
In general, the second approach is more appropriate, and cron jobs can be used if it takes time to run automatically at intervals.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.