01-11-2012, 04:34 PM
Virtual Memory
virtualmemory.ppt (Size: 208.5 KB / Downloads: 43)
Processes deal with virtual memory – they have the
illusion that a very large address space is available to
them
There is only a limited amount of physical memory that is
shared by all processes – a process places part of its
virtual memory in this physical memory and the rest is
stored on disk
The hardware ensures that one process cannot access
the memory of a different process
Memory Hierarchy Properties
A virtual memory page can be placed anywhere in physical
memory (fully-associative)
Replacement is usually LRU (since the miss penalty is
huge, we can invest some effort to minimize misses)
A page table (indexed by virtual page number) is used for
translating virtual to physical page number
The memory-disk hierarchy can be either inclusive or
exclusive and the write policy is writeback
TLB and Cache
Is the cache indexed with virtual or physical address?
To index with a physical address, we will have to first
look up the TLB, then the cache longer access time
Multiple virtual addresses can map to the same
physical address
Does the tag array store virtual or physical addresses?
Since multiple virtual addresses can map to the same
physical address, a virtual tag comparison can flag a
miss even if the correct physical memory word is present
Superpages
If a program’s working set size is 16 MB and page size is
8KB, there are 2K frequently accessed pages – a 128-entry
TLB will not suffice
By increasing page size to 128KB, TLB misses will be
eliminated – disadvantage: memory wastage, increase in
page fault penalty
Can we change page size at run-time?
Note that a single page has to be contiguous in physical
memory