The concept of Linux memory fragmentation

Source: Internet
Author: User

The "fragmentation" in kernel terminology is generally based on physical memory, and I'm not too sure that you can conclude that fragmentation is the logic of the conclusion of address space. But I think, since you know that malloc is a user space call, then your so-called fragments are from the perspective of the user space, but for the user space, see only the address space, all of its access to the address is to go through the page table after the conversion to access the physical page, And the address space allocated by malloc must be contiguous, so the so-called fragment has no meaning for the user space. Do not know what you are tangled in the "fragment" in your mind what the meaning of the end, in addition, you say "if the address space is not continuous, not to mention the physical space continuous", this logic is also problematic, address space and physical space do not have such a so-called link. Physical space is not continuous, is the kernel in the management of physical memory when the time to consider, and user space is completely not related to the user-state perspective, only see the address space is sufficient.

I mean not to emphasize the continuity of virtual addresses and the relationship between physical address continuity, but in the heap, if there is no one to meet the requirements of the user malloc continuous address, then malloc will fail, not to mention to get a contiguous physical memory. My opinion the fragment in malloc is based on virtual memory and is based on this ...

> If there is no contiguous address that satisfies the user's malloc requirements, malloc will fail,

There is no problem with this sentence.

> is much less to get a contiguous piece of physical memory.

This "even less" conjunctions have problems, because there is no relationship between the latter, this statement is problematic, and your implication is that if malloc succeeds, then it is possible to talk about getting a contiguous amount of physical memory. There is a problem with this argument, and you still don't understand the meaning that the user state doesn't have anything to do with continuous physical memory. Even if the user state assigned to the continuous address space, after the page fault is obtained after the physical pages are exactly continuous, this is not the meaning of the discussion, the physical address is not contiguous to the user space has no impact, nor user space can be left or right.

Personally, it is not necessary to define the word fragment to be a physical address space or a virtual address space. Referring to memory fragmentation, the main consideration is two aspects:
1, memory fragmentation is not used effectively and is directly or indirectly wasted.
2, memory fragmentation destroys the principle of locality, resulting in reduced performance.
These should all be for physical memory. It is very rare to say that because "address space fragmentation" is not enough to cause memory requests to fail, compared to the address space, physical memory is more scarce, referring to memory fragmentation of course refers to physical memory.

The concept of Linux memory fragmentation

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.