Differences between Windows awe API memory allocation and normal Memory Allocation

Source: Internet
Author: User

The following points may be a bit different from the actual situation, because I have not read Microsoft's internal documents and cannot find other materials.

It can only be inferred based on the existing information that a person or ox can give directions. Point out the problems. Please click it.

Common memory allocation method:

The left side of the figure shows the normal memory allocation method.

When the virtual memory in the program is submitted, the program will apply for memory from the system, the system will allocate a PFN, a pfn contains a lot of information, mainly representing the memory page, sometimes it can be viewed as a memory page, which is easier to understand.

If Pte is from VAS, that is, virtual memory, when committed to physical memory, PTE records ing information.

The basic process of normal allocation may be as follows. After applying for PFN, the PTE maps to the corresponding PFN, and reads the pages in Vas to the physical memory page corresponding to PFN.

This feeling is relatively simple

Awe memory allocation:

Those who have a deep understanding of SQL Server will know that after SQL server enables awe, the allocated memory will be locked, that is, the locked page, it cannot be released before the program is stopped.

When the program wants the system to request memory in awe mode, the system will apply for a memory from the PFN database, that is, a place for PFN management, and map the physical memory corresponding to the PFN to the virtual memory.

That is, the virtual memory points to the physical memory through a pointer. See the figure below:

When the PFN is mapped to the virtual memory, the PTE will be allocated and bound to the PFN to apply a lock. However, the PFN memory has been mapped to the virtual memory, and the PFN will point to the memory pointer to the Pte.

Therefore, PTE cannot detect how much memory is allocated to the program by awe. Therefore, it is impossible to swap out pages for the memory allocated by awe, resulting in locked page.

  

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.