Optimize virtual memory in Linux

Source: Internet
Author: User
Optimize the virtual memory in Linux-Linux Enterprise Application-Linux server application information. The following is a detailed description. First, check the usage of the virtual memory and use the command

# Free

View the memory usage of the current system.

In general, linux's physical memory is almost completely used. This is very different from windows. Its memory management mechanism makes full use of the system memory. It is not the same for windows to use some virtual memory no matter how large the memory is. Note This.

Use commands to configure virtual memory in Linux

# Cat/proc/sys/vm/freepages

You can view the following three numbers: the minimum memory blank page, the Minimum Memory blank page, and the maximum memory blank page.

Note that the system uses the virtual memory principle: if the number of blank pages is lower than the maximum number of blank pages, the disk swap space is used. When the minimum blank page setting is reached, the memory is used for swap (Note: I have obtained some information and need to observe it for specific applications, however, this does not affect the configuration of new virtual memory parameters ).

Memory is generally allocated in 4 K bytes per page. The Minimum Memory blank page setting is 2 times the number of memory in the system, the Minimum Memory blank page setting is 4 times the number of memory, and the maximum memory blank page setting is 6 times the system memory. These values are determined at system startup.

In general, in terms of configuring the virtual memory configuration allocated by the system, I personally think that increasing the maximum memory blank page is a good configuration method. Take the 1 GB memory configuration as an example:

You can change the original configuration proportion:

2048 4096 6444

Use commands

# Echo \ "2048 4096 6444 \">/proc/sys/vm/freepages

Because the maximum blank page configuration is added, the memory can be used more effectively.
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.