Week 9 - Memory Management Flashcards
Name the different ways addresses are represented during a program’s life?
Source code: Symbolic.
Compiled code: Bind to relocatable addresses.
Linker/Loader: Bind relocatable to absolute addresses.
Describe Logical versus Physical address space?
Logical: Address generated by CPU.
Physical: Loaded into memory address register of memory.
Logical must be mapped to physical before use.
Explain Dynamic Linking and its advantages?
Linking postponed until execution time.
Stub used to locate appropriate memory resident routine, replacing itself with address of routine.
Advantages: Libraries, including updates and shared libraries.
Describe Multiple-Partition Allocation?
Divide memory into partitions, each containing a process.
Number of partitions limits degree of multiprogramming.
Processes loaded into free partitions (holes).
Holes can be variable sized for efficency.
Problem - External and Internal Fragmentation.
What are the solutions to the Dynamic Storage-Allocation Problem?
First-Fit: Allocate first hole that is big enough.
Best-Fit: Allocate smallest hole that is big enough (must search entire list).
Worst-Fit: Allocate largest hole (must search entire list).
Describe Coalescing?
Reduces external fragmentation.
Combine adjacent free blocks into one large block.
Describe Compaction?
Reduces external fragmentation.
Shuffle all free memory into one block.
Disadvantage: CPU idle.
What is the equation for Effective Access Time?
EAT = Hit Ratio x Memory Access + Non-Hit Ratio x Memory Access
How can memory be protected in Paging?
Valid/Invalid Bit.
Describe Virtual Memory?
Mechanism to separate user logical memory from physical memory.
Allows addresss space to be shared by several processes.
What are the advantages of Virtual Memory?
Allows for more efficent process creation.
Allows for more programs to run concurrently.
Less I/O needed to swap or load processes.
Described Demand Paging?
Only brings page into memory when needed.
Similar to paging with swapping.
Lazy Swapper: Never swaps a page into memory unless needed.
Name the three Page Replacement algorithms?
FIFO: Adding more frames can cause more page faults (Belady’s Anomaly).
Optimal Page Replacement: Replace page that will not be used for the longest time, how to predict?
LRU: Replace page that hasn’t been used for the longest time.
What is Thrashing?
Low CPU utilization, caused by a process being busy swapping pages in and out.
OS thinks it needs to increase degree of multiprogramming, adds another process but not enough pages…