How do I manually release Linux memory?

Source: Internet
Author: User

In the production process, some Java modules will be more cruel to eat the system memory, and if the module is written less, the resulting garbage will be more, if the Linux system memory release will not be timely, and then the vicious circle, and finally the process card to die, but the server is not down machine, So this time we need to transport out, manually release the memory.


First, we log on to a server,#free-M to see the current situation:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/8B/DC/wKioL1hbTGqiHOMFAAAlZBSGIcU923.png "title=" 1.png " alt= "Wkiol1hbtgqihomfaaalzbsgicu923.png"/>


Then #cat/proc/sys/vm/drop_caches, you will see that the value inside is 0,0 is not released.


#sync, the dirty data in the system cache is written to disk, including modified I-node, deferred block I/O, and read-write mapping files.


# echo 3 >/proc/sys/vm/drop_caches


#sysctl-P, which can take effect without restarting the server. After the following series of text appears, #free-M look at:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/8B/DC/wKioL1hbTeLSLD8xAADa8uf_SNE346.png "title=" 1.png " alt= "Wkiol1hbtelsld8xaada8uf_sne346.png"/>


Released from 112 to 2790, visible results are immediate.

This article is from "Life is waiting for Gordo" blog, please make sure to keep this source http://chenx1242.blog.51cto.com/10430133/1885022

How do I manually release Linux 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.