One: Memory fragmentation and paging.
Click to open link
Each user space of the Linux process has a 3G address space, (virtual address space 3g-4g space is used by the Linux kernel), the user space to see the process address refers to the virtual address space, and then the operating system through the MMU and then map the virtual address to the actual physical address.
Segmentation: is to map the entire program to the physical address of the Linux memory, assuming that there are two processes a and B, process a requires a memory size of 10M, its virtual address space is distributed in 0x00000000 to 0x00a00000, process B requires a memory of 100M, its The virtual address space is distributed to 0x00000000 to 0x06400000. Then, according to the segmented mapping method, process A maps the area on the physical memory to 0x00100000 to
0x00b00000, process B maps the area on physical memory to 0x00c00000 to 0x07000000. So process A and process B are mapped to different memory ranges, each of which does not overlap each other, and it realizes the address isolation '
paging: because a fragment can only map the entire program to the physical address space, this can result in a lot of disk access operations, resulting in inefficiency. So this mapping method is slightly coarse, the granularity is larger, and the idea of paging is that the program's really executed pages will be mapped into memory.
[Linux Memory]linux Memory Learning (ii)--segments and pagination