Linux kernel parsing process fork operation

Source: Internet
Author: User

Recently encountered a strange phenomenon on the line, Redis in the RDB persistence, the background exposed can not allocat memory error

Specific errors See error analysis in the Redis module

Here are the main instructions for fork (), and the copy-on-write operation

The Linux kernel adds copy-on-write to the fork operation after 2.6 to improve system reliability and performance

The first explanation is fork (), just a confirmation of the resource (here is determined by the Vm.overcommit parameter),

Many of the online overcommit parameters are said to be misunderstanding

In simple terms,

0-System default, the application is relatively safe and reasonable, is the current free memory and swap and the amount of memory required to do the comparison

1-relatively idealized, not suitable for production processes, regardless of request memory, direct release

2-factor configurable, can limit the amount of memory used for the system of how much, convenient configuration


The above confirmation determines whether fork can continue to go down

However, the actual memory resource request occurs at write time, and the master and child processes are shared by the memory resources.

If the main process simultaneously operates a write operation of memory, then the child process requests the same size memory area, and the resource occupies until the end.


Linux kernel parsing process fork operation

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.