Memory Management Flashcards
What does memory hold ?
A programs data and instructions for execution by the CPU
What are the key challenges of memory management ?
Keeping multiple processes in memory simultaneously,
maintaining performance,
protecting processes from one another,
Allowing shared memory for inter process communication,
enable simple memory addresses
What is process loading ?
A process is moved from the disk to memory before execution
What is swapping ?
When two processes swap places with each other (From memory to the disk and vice versa)
What do we need to be able to perform swapping ?
preservation / restoration of process state,
swap space on disk and memory,
ideal candidates for swapping
What is fixed partition memory ?
Memory is divided into fixed partitions,
The OS has one partition and the others are allocated to processes.
What are advantages and disadvantages of FPM ?
Advantages:
Efficient use of memory
enables multi-programming
Disadvantages:
Processes may be too large for partitions
wasted memory due to fragmentation
What is Variable partition memory ?
Memory is allocated based on process size,
provides better memory utilisation than FPM
What determines how processes are allocated in PM ?
placement policies:
Best fit - smallest available block that fits the process,
Worst fit - largest available block,
First fit - first available block
What is fragmentation ?
When processes terminate, they leave small gaps in the memory, these gaps are often too small to fit other processes which leads to inefficient memory space
What is Memory compaction ?
A method used to reduce fragmentation. Shifts processes to consolidate free memory
What is paging ?
Memory is divided into fixed sized pages,
Processes are split across multiple page frames,
logical addresses are split into:
page number,
displacement
page table stores addresses
What is segmentation ?
instead of fixed size pages, variable size segments.
logical addresses split into:
segment reference,
displacement,
segment tables store addresses