pages and memory are related as follows:
When two objects are partitioned in the same way, they are described as being aligned. The two objects do not necessarily have to use the same partitioning function to be aligned.
If NumberOfBytes is PAGE_SIZE or greater, a page-aligned buffer is allocated. Memory allocations of PAGE_SIZE or less are allocated within a page and do not cross page boundaries. Memory allocations of less than PAGE_SIZE are not necessarily page-aligned but are aligned to 8-byte boundaries in 32-bit systems and to 16-byte boundaries in 64-bit systems.
we defined “aligned” as the case when base object and in-build index use the same partition schema, and “non-aligned” to be the case when heap and index use different partition schemes, or the case when heap is not partitioned.
Process Working Set
The working set of a process is the subset of its virtual address space that is in use at a given time. A process’s working set can be divided into two main categories: shareable pages and private pages. The upper-left pane in Resource Monitor displays the size of the working set for each process as “Working Set (KB)”.
Shareable Pages
Shareable pages are memory-resident pages that can be shared with other processes. One copy of the page is physically in memory and is mapped into the virtual address space of one or more processes, as required. Examples of shareable pages include executable image files and memory-mapped files.
System DLLs such as Ntdll, Kernel32, Gdi32, User32, Advapi, Commctl32, and Msvcrt are shareable. This optimization saves memory space and benefits most processes because only one copy of the page is required.
Private Pages
Process private pages—also called the private working set—are the resident, non-shareable memory pages that are currently mapped into a process’s virtual address space. Resource Monitor shows the size of the private working set for each process. This metric is typically used to measure the memory impact of an application. However, this number does not show peak memory use or memory that is used for the application but is not reflected in the memory manager working set data structures. For example, the private working set does not include cached file access, memory in services that the application calls, shared pages, or shareable pages.
Examples of process private pages are:
• Pages on the process heap, common language runtime (CLR) heap, C runtime heap, and so on.
• Private memory allocations that the process requests by calling VirtualAlloc.
• Pages that are part of the user stack that the system maintains for every thread.
• Pages that were marked as copy-on-write and have since been copied.
Pages Not Included in a Process Working Set
Many pages are indirectly accessed for a process and do not appear in its working set. The following are the most important pages:
• Pages that are maintained in kernel memory, such as data in paged and non-paged pools, kernel stacks, pages that are part of the hardware application layer (HAL), and pages that are part of Win32k.sys.
• Pages that other processes, such as a spooler, access for this process.
• Files that the process reads by using buffered read APIs such as ReadFile.
During Windows development, we observed some systems that corrupt the lowest 1 MB of physical memory during a sleep transition. We traced the memory corruption to code defects in platform firmware. Because of the pervasiveness of the problem in the industry and the desire for reliable sleep transitions, Windows no longer stores operating system code and data in the lowest 1 MB of physical memory.
References