Reputation: 199
let's assume we have 4 GiB of RAM and we use a page table size of 4 kiB, with 32 Bit addresses.
After my calculations, I got:
But what I can't understand is, if a page table has 2^20 entries we already covered all the possible addresses with this page table. How is possible if each process has his own page table? It should then be possible to have the same physical address on more than one page table, which could cause severe problem, or am I missing something?
Many thanks in advance for your help.
Upvotes: 0
Views: 47
Reputation: 12435
Each process can in theory map all of memory, but in practice, most of the pages in a process's address space are not mapped, leaving plenty of memory for other processes.
Furthermore, it doesn't necessarily cause a problem to have the same pages mapped into two different address spaces. It is done for shared libraries, kernel pages, and memory that is shared between processes for interprocess communication.
(Kernel pages may be mapped into every process so that the kernel can access its own pages during a system call from any process. These pages are protected so that they cannot be accessed by the application code.)
Upvotes: 0