How to view and clean the system memory space under CentOS

Source: Internet
Author: User

Sometimes when you open a lot of memory-intensive programs on the server, but after you close these programs, you find that the memory space is still the same as when the application is not closed, so that other applications open when the memory is not enough or very card, then you want to clean up the previous program when the memory occupied by the open. And most of the cache data is occupied, then how to clean up the memory? You can use the following steps to clean up your memory:

Most Linux servers have a caching mechanism enabled by default, and viewing the configuration file cat/proc/sys/vm/drop_caches of 0 means that the caching mechanism is turned on, which is very effective when running a service and facilitates fast reading of the service itself. Sometimes it is found that with the increase of the time of the site running, the memory consumption is increasing, so the system cache should be cleaned up and free of space in time.

1. View memory usage before cleanup

Free-m

2. Start cleaning up

echo 1 >/proc/sys/vm/drop_caches

3. View memory usage after cleanup

Free-m

The drop_caches in the above command means that the system cleans up the cache of the memory pages, resulting in more usable memory, and a description of the configuration and parameters of the Drop_caches file can be found in the following: Http://www.linuxinsight.com/proc_sys_ Vm_drop_caches.html

How to view and clean the system memory space under CentOS

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.