1/11
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
virtual memory
increases available address space by illusion of a large and private main memory
run programs larger than memory
must translate each memory reference which is slow
segmentation
process data is allocated to contiguous segment of memory
base + bound to map virtual to physical address
base: physical memory location of segment
bound: segment size
bound - base = size of virtual address space
how to translate virtual to physical address
check if requested address <= bound for that process (bound register)
if not, stop under bound violation
else add base register value to virtual address
external fragmentation
small portions of memory are free but not contiguous
defragment
move memory around so free memory is in a contiguous block
computationally expensive and complex
paging
main and virtual memory divided into equal sized segments
no page shared between multiple processes
don’t have to be contiguous
how are page addresses stored
virtual page number (virtual page location of address) + offset (location of address within page)
only page field changes, determined by page table for each process
how does the page table work
uses virtual page field as index to find corresponding page field
also stored valid bit (0 if corresponding page in memory, 1 if not)
page fault
valid bit is 0 for requested process so page is fetched from disk
internal fragmentation
not entire allocated page is being used so memory is being wasted
what is a good balance between a paging and segementation system
divide virtual addresses into segments of variable length
segments and main memory are divided into fixed size pages
each segment has its own page table, so every process has multiple page table
TLB
translation look aside buffer
special cache to store recent page look ups
reduces access to main memory as to access a main memory address you need to access it twice, once for page address then for physical address