linux virtual address and physical address

In the Linux system, the process accesses the virtual address space, and these virtual addresses are mapped to the actual physical address space. A physical address is an actual address in hardware memory, while a virtual address is an address as seen by a process, that is, an independent address space allocated by the operating system to each process at runtime.

The mapping relationship between virtual addresses and physical addresses is maintained by the kernel. When a process accesses a virtual address, the operating system translates it into a corresponding physical address, thereby realizing access to memory. This process is called memory management unit (MMU) address translation.

In a Linux system, the virtual address space is usually divided into multiple areas, such as code area, data area, heap area, stack area, and so on. Each area has its corresponding access rights and properties. The physical address space corresponds to physical memory, including main memory and cache.

The mapping relationship between virtual address and physical address is very important, which directly affects the performance and efficiency of memory management. The operating system manages this mapping relationship through some mechanisms, such as paging mechanism, virtual memory management, etc., so as to realize efficient management of memory.

Guess you like

Origin blog.csdn.net/qq_37464479/article/details/129237117