2. Traditional paging system
One slot for each virtual address, used or not
A very large number of total table entries
Inverted page table
One entry per physical page
One page table for the whole system
Used in some 64-bit systems (UltraSPARC, PowerPC,
etc)
3.
4. Virtual address: <pid, page-number, offset>
Page table entry <pid, page-number>
For each address:
Search the page table entry for <pid, page-number>
If found, <I, offset> is the physical address
If not found, address not in physical memory
Table search can be time consuming. It is typically
based on hashing.
5. o The number of page table entry is proportional to the
size of physical RAM
o Collision handling
o Hard to do shared memory (multiple pid mapping to
the same physical address).
Each inverted page table entry is a pair:
<process-id, page number>
6. In computer operating systems, demand paging is a
method of virtual memory management.
7. When a process tries to access a page, the following
steps are generally followed:
Attempt to access page.
If page is valid (in memory) then continue processing
instruction as normal.
If page is invalid then a page-fault trap occurs.
Check if the memory reference is a valid reference to
a location on secondary memory. If not, the process is
terminated (illegal memory access). Otherwise, we
have to page in the required page.
Schedule disk operation to read the desired page into
main memory.
Restart the instruction that was interrupted by the
operating system trap.
8. Advantages
Only loads pages that are demanded by the
executing process.
As there is more space in main memory, more
processes can be loaded
Less loading latency occurs at program startup,
as less information is brought into main memory.
As main memory is expensive compared to
secondary memory, this technique helps
significantly reduce the bill of material (BOM)
cost in smart phones for example. Symbian OS
had this feature.
9.
10. Thrashing occurs when a computer's virtual
memory subsystem is in a constant state of paging,
rapidly exchanging data in memory for data on disk, to
the exclusion of most application-level
processing. This causes the performance of the
computer to degrade or collapse. The situation may
continue indefinitely until the underlying cause is
addressed.