32-bit system. When setting vm. min_free_kbytes, pay attention to the lowmem value.

Source: Internet
Author: User

32-bit system. When setting vm. min_free_kbytes, pay attention to the lowmem value.

The Memory Policy in the kernel is adjusted today. One machine is a 16 GB 32-bit system with 16 GB memory. the min_free_kbytes value is set to 5% of the physical memory, that is, the memory is automatically released when it is less than 5%. Like other machines, edit sysctl. after conf, run sysctl-p. The result is a tragedy, and the server goes down immediately. If no result is returned after the data center is restarted, a single user will not be able to access the system. The message "Kernel panic-not syncing" is reported: out of memory and no killable processes ..., you can only log on to the data center and use a CD to start the rescue mode. You can log off the system with the policy you just added.

Unwilling to try setting up the vm again. min_free_kbytes value. The sysctl-p result is the same, and the final value is set to 2%. If no problem occurs, check the messages and check the kernel record: the 896 mb lowmem available clause does not seem to have been seen in other systems, so he can find the cause from him.

Cause of downtime:

Vm. min_free_kbytes is set to a value higher than LowTotal. The system considers that there is not enough lowmem, and triggers OOM Killer to forcibly kill the process.

Specific analysis:

In the system, the memory is divided into lowmem and highmem, and lowmem is the addressing memory. When lowmem is used up, the system will trigger OOM Killer to kill redundant processes to release the memory (2.6 kernel to kill the process that occupies the highest memory)

Among them, the 64-bit system will divide all the memory size into lowmem to prevent lowmem from being insufficient, while 32 is separated by the system, and the maximum is about MB, you can use the egrep 'high | low'/proc/meminfo command to view details.

If you set vm. if the value of min_free_kbytes is greater than the value of LowTotal, the system determines that there is not enough memory to trigger OOM Killer until all processes are killed, when a process is started at startup, the system determines that the memory is insufficient and kills the process.

(OOM Killer is triggered when the vm. min_free_kbytes value is set to 1 greater than the lowmem value)

Simply put, for example, if you use 32-bit XP, if you use 4G memory, the system can only recognize 3.5 GB. In 32-bit linux, the system considers lowmem as the current memory size. As long as lowmem is insufficient, it considers that the memory is insufficient. Then, it begins to kill the process to release and set the vm. min_free_kbytes also sets the number of lowmem records that are idle by the system. Therefore, an exception occurs when the set value exceeds lowmem.

Therefore, before the 32-bit system is set, check the actual lowmem size. Although the maximum value is 896 MB, I have more than MB of 16 GB machines, the specific reason is the kernel mechanism. If you have time to study it, you can now know how to die.

The lesson of blood, such as a large memory machine, is to use a 64-bit system later. A 32-bit system will cause problems without your knowledge.

Note: In a 32-bit system, the higher the physical memory, the higher the lowmem consumed. The 16 GB server consumes about 4 times the 4 GB memory.

This article permanently updates the link address:

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.