Some simple ideas about Windows memory

Source: Internet
Author: User

1. Company's products have a check the functionality of the Windows operating system to verify that the client-only operational requirements are met:

The available virtual memory in this is 128T feel very strange.

And then I think about it. 128T is 2 of the 47-time Square

Conjecture is whether the WINDOWS10 takes a 47-bit address bus bit width for VAS virtual memory addressing.

Then we checked the parameter limits for Winserver 2016:

A single machine supports 24T of memory, which should be less than 2 of the 45-time addressing space.

Intel's latest 8180M CPU unit price 13k cutter can use 1.5T of memory, 8 socket under the use of 12T memory

It seems that win2016 is fully capable of running 8 of Intel's servers and fully manages the memory.

But it's pretty scary to see this parameter.

After all, 8180 full-match words are the core number after 448 Hyper-threading.

Understanding is very simple, do not know right.

Microsoft's official explanation:

https://technet.microsoft.com/zh-cn/library/hh439648

Virtual address space

When the processor reads or writes to the memory location, it uses the virtual address. As part of a read or write operation, the processor translates the virtual address into a physical address. Accessing memory through virtual addresses has the following advantages:

    • A program can use a series of neighboring virtual addresses to access large, non-contiguous memory buffers in physical memory.

    • A program can use a series of virtual addresses to access memory buffers that are larger than the available physical memory. When the physical memory supply is small, the memory manager saves the physical memory page (typically 4 KB) to the disk file. The data or code page moves between the physical memory and the disk as needed.

    • Virtual addresses used by different processes are isolated from each other. Code in one process cannot change the physical memory that is being used by another process or by the operating system.

The virtual address range available for a process is called the virtual address space for the process. Each user-mode process has its own private virtual address space. For 32-bit processes, the virtual address space is typically 2 GB, ranging from 0x00000000 to 0x7FFFFFFF. For 64-bit processes, the virtual address space is 8 TB and ranges from 0x000 ' 00000000 to 0x7ff ' FFFFFFFF. A series of virtual addresses is sometimes called a series of "virtual memory".

This figure illustrates some of the important functions of the virtual address space.

The figure shows the virtual address space for two 64-bit processes: Notepad.exe and MyApp.exe. Each process has its own virtual address space, ranging from 0x000 ' 0000000 to 0x7ff ' FFFFFFFF. Each shaded box represents a page of virtual memory or physical memory (4 KB in size). Note that the NOTEPAD process uses three contiguous pages of virtual addresses starting from 0x7f7 ' 93950000. However, these three contiguous pages of the virtual address are mapped to nonadjacent pages in physical memory. Also note that two processes use a virtual memory page starting with 0x7f7 ' 93950000, but these virtual pages are mapped to different pages of physical memory.

User space and system space

Processes such as Notepad.exe and MyApp.exe run in user mode. Core operating system components and multiple drivers run in more privileged kernel mode. For more information about processor mode, see user mode and kernel mode. Each user-mode process has its own private virtual address space, but all code running in kernel mode shares a single virtual address space called system space. The virtual address space for the current user-mode process is called user space.

In 32-bit Windows, the total amount of virtual address space available is 2^32 bytes (4 GB). Typically, the lower 2 GB is used for user space, and the upper 2 GB is used for system space.

In 32-bit Windows, you can specify (at startup) that more than 2 GB is used for user space. As a result, fewer virtual addresses are available for system space. You can increase the size of the user space to 3 GB, in which case the system space is only 1 GB. To increase the size of the user space, use bcdedit/set increaseuserva.

In 64-bit Windows, the theoretical size of the virtual address space is 2^64 bytes (160 billion bytes), but only a small fraction of the 160 billion-byte range is actually used. The 8 TB range from 0x000 ' 00000000 to 0x7ff ' FFFFFFFF is used for user space, ranging from 0xffff0800 ' 00000000 to 0xFFFFFFFF ' FFFFFFFF of 248 TB parts for system space.

Code running in user mode can access the user space, but not the system space. This restriction prevents user-mode code from reading or changing protected operating system data structures. Code running in kernel mode can access both user space and system space. That is, code running in kernel mode can access the virtual address space of the system space and the current user-mode process.

Drivers running in kernel mode must be very careful when reading or writing to these addresses directly from the user-space address. This scenario illustrates the reason.

    1. The user-mode program initiates a request to read some data from the device. The program provides the starting address of the buffer to receive data.

    2. A device driver routine running in kernel mode initiates a read operation and returns control to its calling program.

    3. Then, the device interrupts any currently running threads to show that the read operation is complete. Interrupts are handled by a kernel-mode driver routine running on this arbitrary thread, which is part of an arbitrary process.
    4. At this point, the driver must not write data to the start address provided by the user-mode program in step 1. This address is located in the virtual address space of the process that originated the request, and the process may be significantly different from the current process.
Paged pool and non-paged pool

In user space, all physical memory pages can be paged to disk files as needed. In system space, some physical pages can be paged, while other pages cannot. System space has two zones for dynamically allocating memory: paged pool and non-paged pool. In 64-bit Windows, the paged pool is a virtual address of GB, ranging from 0xffffa800 ' 00000000 to 0xffffa81f ' FFFFFFFF. Non-paged pool is a virtual address of GB, ranging from 0xffffac00 ' 00000000 to 0xffffac1f ' FFFFFFFF.

The memory allocated in the page cache pool can be paged to disk files as needed. Memory allocated in non-paged pool can never be paged to a disk file.

A private working set is a subset of the working set, which is a technical term that describes the amount of memory used by each process. A private working set specifically describes the amount of memory that a process is using and cannot share with other processes

Memory-The working set is the sum of the amount of memory in a private working set that the process is using and can be shared by other processes.
Memory-Peak Working set is the maximum number of working set memory used by the process.
Memory-The working set increment is the amount of change in the working set memory used by the process.
Memory-The commit size is the amount of virtual memory that is reserved for use by a process.
Memory-The paged pool is the amount of recognized virtual memory for a process that can be written to other storage media, such as a hard disk.
Memory-non-paged pool is the amount of recognized virtual memory for a process that cannot write to other storage media.

Some simple ideas about Windows memory

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.