2

An operating system use Page Directory and Page Table to handle memory virtualization.

One thing I am not sure about is in the title of this question: Is that structure the same for every process, or does each process own a specific Page Table ?

It seems cumbersome and impractical to have a Page Table for every process. There is also the fact that the whole data structure (Page Directory, Page Table...) seem to address every byte of physical memory.

user96649
  • 121
  • 2
  • 3

1 Answers1

2

Each process in a operating system implementing virtual memory has its own address space. This is more secure as it allows isolation between processes, and address randomization. Also easier to manage with different physical memory configurations, and allows overcommit.

The address space size may in fact be significantly bigger than the amount of physical memory. This is a feature: more space for address randomization, mapping files in, and other neat tricks.

On Linux (although other operating systems are surely similar) each process has its own set of page tables. Maybe 4 bytes spent managing 4 KB of page frame used, manageable. Although, use a large amount of memory multiplied by a large number of processes, and your page tables use significant memory and CPU. This happens sometimes for large databases in particular, and can be mitigated by using a larger ("huge") page size.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32