(9) Memory Management Flashcards
What are the goals and tools of memory management
- Allocate memory resources among competing processes
- Provide isolation between processes
- Convenient abstraction for programmers
- Provide tools
What do base and limit registers do?
A pair of base and limit registers define the logical address space.
CPU must check between every memory access generated in user mode to be sure it is between the base and limit for that user.
What are logical/virtual addresses?
They make it easier to manage memory of multiple processes. They are independent of location in physical memory. The OS determines the location in physical memory. CPU instructions reference virtual address. These are then translated by hardware into physical addresses.
What is the address space of a process?
The set of virtual addresses a process can reference.
What is an MMU?
A memory-management unit. At run time it maps virtual to physical addresses.
What is the main benefit to swapping?
Total physical memory space of processes can exceed physical memory
Describe Backing Store swapping
Large enough to accommodate copies of all memory images for all users.
Must provide direct access to these memory images.
Describe Roll out, Roll in swapping
Used for priority-based scheduling algorithms.
Lower-priority process is swapped out so higher priority process can be loaded and executed.
Does the swapped out process need to swap back in to the same physical addresses?
Depends on address binding method
-MMU prevents the need for this
How can you reduce the cost of swapping?
Can reduce the size of memory swapped by knowing how much memory is really being used
Syscalls to inform OS of memory use via request_memory() and release_memory()
What id double buffering?
Always transfering I/O to kernel space the to I/O device. It adds overhead.
What are relocation registers?
- Used to protect user processes from each other, and from changing operating-system code and data
- Base limit register contains value of smallest physical address
- Limit register contains range of logical addresses and each logical address must be less than the limit register
Describe fixed partition allocation
Physical memory is broken into fixed partitions
Requires base register and limit register
+Simple
-Internal fragmentation: the available partition is larger than what was requested for process.
Describe variable partition allocation
Physical memory broken into partitions dynamically - partitions tailored to programs.
-Requires base register and limit register
+No internal fragmentation as we allocated just enough
-External fragmentation, as we load and unload holes are left scattered throughout physical emmory
What is a hole?
A block of available memory. Holes of various sizes are scattered throughout memory