Memory Management Flashcards
What is relocation?
Programmer doesn’t know where program will be placed when being executed. It my be swapped to disk and returned to main memory at different location. Memory references must be translated to actual physical addresses.
What is protection with regard to memory management?
Processes musn’t be allowed to reference memory locations in another process. Therefore it’s impossible to check absolute addresses in a program as program could be relocated. It must then be checked during execution.
What is sharing with respect to memory management?
It allows several processes to access the same memory. Co-operating processes share access to same data structure. It says it’s better to allow each process access to same copy of the program rather than have it’s own seperate copy.
What are the five memory management techniques?
Fixed partitioning, dynamic partitioning, demand pages allocation, segmented memory allocation, virtual memory
What is fixed partitioning?
Divide memory into equal or non equal partitions. If all partitions full OS swaps a process with lesser process. Inefficient, results in fragmentation.
What are overlays?
Solution for when process is too large for partition. A part (resident part) of program always present in memory, rest of program swapped in and out as needed.
What are advantages and disadvantages of equal-sized partitions versus non-equal?
Equal: easier to implement, processes bigger than partition require overlay, smaller processes still require partition unit.
Non-equal: more flexibility, less waste, accommodates large processes without overlay.
What is first placement algorithm for fixed partitioning?
Seperate queue for each partition. Processes added to queue for smallest partition they fit in. Minimizes fragmentation. Most efficient for individual partition.
What is problem with first placement algorithm?
Not efficient for system as a whole. Process throughout decreased as processes must queue even when there are larger free partitions available.
What is second algorithm for process placement?
One queue rules them all. Process routed to smallest available partition.
What so dynamic partitioning?
Allows OS to create partition of any size. Eliminates internal fragmentation. However unusable gaps appear over time (external fragmentation). Compaction minimizes external fragmentation. Must be done regularly.
What is first placement algorithm for dynamic partitioning?
Best fit: chooses block by size, leaves smaller fragmented holes compaction required more often.
What is second placement algorithm for dynamic partitioning?
First-fit: fastest,
What is third algorithm for placement in dynamic partitioning?
Next-fit: largest block of memory is broken up into smaller blocks, compaction required to obtain large block at end of memory
What is paging?
The OS divides processes into equal sized chunks (pages) and slots them into equal sized memory frames. Must maintain a page table and memory map. Advantage: process doesn’t need to wait for one whole memory space