I’m studying O.S,
just wondering about who create page table for process, I guess OS create it for each process, if I’m not wrong,
now here’s my question, since the OS handle the create and maintain of page table, how come there’s a situation that page table is larger than the program required??( and then a valid-invalid bit is now required),
but imagine, if there’s no such situation, there’s no need for this extra bit flag, am I correct?
please help me get out of this marsh, thanks a lot!!
Imagine the opposite of what you describe. Imagine the page table is exactly large enough for what the program requested.
What happens when the program decides to allocate additional memory? The page table must be grown.
If the program deallocates memory, the page table would have to be immediately shrunk.
That approach is potentially expensive if there are many allocations and deallocations.