Linux Process Address Space Distribution

Source: Internet
Author: User

The virtual address space in Linux is also 0 ~ 4G. The Linux kernel divides the space of 4G bytes into two parts. The maximum 1 GB (from the virtual address 0xc0000000 to 0 xffffffff) is used by the kernel, which is called "kernel space ". The lower 3G bytes (from the virtual address 0x00000000 to 0 xbfffffff) are used by each process, called "user space ". Because each process can enter the kernel through a system call, the Linux kernel is shared by all processes in the system. Therefore, from the perspective of a specific process, each process can have 4 GB of virtual space.
It is important that the virtual address space is not the actual address space. The process address space is allocated, and 4G is only the maximum. Generally, the address space of a process is always less than 4 GB. You can view the/proc/Pid/maps file to learn the address space of a specific process. However, the address space of the process does not correspond to the actual physical page. Linux uses the lazy mechanism to allocate the actual physical page ("demand paging" and "and copy on write) to improve the actual memory usage. That is, each virtual memory page does not necessarily correspond to a physical page. The ing between a virtual page and a physical page is implemented through the ing mechanism, that is, the page table is mapped to the actual physical page. Because each process has its own page table, the same virtual address of different processes can be mapped to different physical pages, this makes it possible for different processes to have 4 GB of virtual address space at the same time.

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.