[OS]Main memory management
Memory Background
processor registers <-> (word) cache memory <-> main memory <-> (block) auxiliary storage(Disk)
- Block
- Size: 1 ~ 4KB
- Word
- Size: 16 ~ 64 bits
Address Binding
- Compile time binding
- Load time binding
- Run time binding
Dynamic Loading
- Save all routines to disk in replaceable form
- Efficient use of memory
Swapping
- Swap-out
- Swap-in
Memory Allocation
- Continuous Memory Allocation
- Uni-programming
- Multi-programming
- Fixed partition (FPM)
- Variable partition (VPM)
- Non-continuous Memory Allocation
Uni-Programming
- Multiprogramming degree = 1
- Problem
- Program Size > Memory Size
- Kernel Protection
- Low system resource utilization
- Low system performance
- Soultion
- Overlay structure.
- Use boundary register
- Multi-programmin
Fixed Partition Multiprogramming
- Process : Partition = 1 : 1
- Multiprogramming degree = k
- Fragmentation
- Internal fragmentation
- External fragmentation
Variable Partition Multiprogramming
- No internal fragmentation
- External fragmentation issue
- Coalescing holes
- Low overhead
- Storage Compaction
- High overhead
- Coalescing holes
- Placement strategies
- First-fit
- Simple and low overhead
- Best-fit
- Worst-fit
- Next-fit
- Low overhead
- First-fit