How to clean up system memory in GNU/Linux

Source: Internet
Author: User

How to clean up system memory in GNU/Linux

/*************************************** ******************************* Author: samson * Date: 04/21/2015 * Test platform: * gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2 * GNU bash, 4.3.11 (1)-release (x86_64-pc-linux-gnu) **************************************** ****************************/

After opening a lot of programs that will occupy the memory, close these programs and find that the memory space is the same as that used when the application is not closed, as a result, when other applications open the memory is not enough or very card, then you want to clear the memory occupied by the previous program open, and most of the memory is occupied by the cache data, so how to clean up the memory? You can use the following steps to clean up the memory:

In most GNU Linux, the cache mechanism is enabled by default. If the configuration file cat/proc/sys/vm/drop_caches is 0, the cache mechanism is enabled, this mechanism is very effective when a service is always running, so that the service itself can be quickly read. As a desktop user, the opened program is not so simple, therefore, it is recommended that you set this configuration file to 1 to clean up the system cache and release the space for other programs.

1. memory usage before cleanup
Free-h

2. Start cleaning


Echo 1>/proc/sys/vm/drop_caches

3. memory usage after cleaning
Free-h

 

Drop_caches indicates that the system clears the cache of the Memory Page to obtain more available memory.

 

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.