Week 7: Memory Management: Variable partitions Flashcards
What is swapping?
Moving processes between main memory and hard disk to manage limited memory in timesharing systems.
Why is swapping less effective with fixed partitions?
If a large process is swapped out of a large partition, there may
only be small processes ready to run
How does variable partition multiprogramming improve memory usage?
Partitions are dynamically created and freed based on the size of processes.
What are the trade-offs of variable partitions?
Increased complexity in allocation, deallocation, and memory tracking.
What is the allocation data structure required to
deal with a variable number of free and used partitions?
The Linked List
How does the first fit allocation strategy work?
The linked list is scanned to find the first free space large enough for the process. The remaining space, if any, is split into a new free block.
How does the next fit allocation strategy work?
It’s a variation of the first fit. Instead of starting from the beginning again, the next fit continues scanning from the last allocated block
How does the best fit allocation strategy work?
The best fit algorithm always searches the entire linked list to find the smallest hole big enough to satisfy the memory request
What is the downside of the best fit strategy?
It often creates tiny, useless memory holes due to breaking blocks into exact sizes.
How does the worst fit strategy work, and why is it ineffective?
It allocates the largest free block, but simulations show it performs poorly
What is quick fit, and when is it useful?
It maintains separate lists for common block sizes, speeding up allocation. However, it still suffers from fragmentation.
How do BitMaps work?
Memory is divided into fixed-size blocks, and a bit map tracks usage (0 for free, 1 for allocated).
What is the downside of BitMaps?
it are less flexible and slower for large memory requests.
What is fragmentation in memory management?
Fragmentation occurs when free memory is divided into small, non-contiguous blocks, making it difficult to allocate large processes.
What is the difference between internal and external fragmentation?
- Internal Fragmentation: Wasted space inside allocated memory blocks.
- External Fragmentation: Wasted space in free memory due to scattered small blocks.
How does coalescing free space work?
Adjacent free memory blocks are combined into a single larger block.
How does compacting free space work?
All the free space available is joined together at any time so that all allocated memory is together (at the start) and all free memory is together (at the end)
Why is compacting more challenging than coalescing?
Compacting requires moving processes in memory, which is time-consuming and often requires swapping processes out and back in.
In what situation is compacting necessary?
When scattered free memory blocks are insufficient for a large process, despite having enough total free memory.
What challenge arises if only the exact memory size is allocated to a process?
If a process needs more memory, adjacent space must be free, or other processes must be moved/swapped to expand the block.
What is a potential solution to the dynamic allocation problem?
Allocating extra memory initially, though determining the right amount can be difficult.