Summary ch8
Last updated
Was this helpful?
Last updated
Was this helpful?
Memory Management: Memory needs to be allocated to ensure a reasonable supply of ready processes to consume available processor time
Memory Management Requirements:
-Protection: Processes should not be able to reference memory locations in another process without permission
-sharing: Allow several processes to access the same portion of memory
-Relocation: While the program is executing, it may be swapped to disk and returned to main memory at a different location (relocated); Memory references in the code must be translated to actual physical memory address
Steps for loading a process in memory:
Address Binding
-Source program: symbolic (such as count)
-After compiling: re-locatable address
-After linkage editor, loader or run-time referring: absolute address
Binding at Compile Time
Binding at load time Must generate re-locatable code if memory location is not known at compile time -Physical memory address is fixed at load time -Must reload if starting location changes
Binding in execution time
Binding delayed until run time
Logical vs. Physical Address Space
The concept of binding a logical address space to a physical address space is central to proper memory management
-Logical address – generated by the CPU; also referred to as virtual address
-Physical address– address seen by the memory unit
In compile-time and load-time address-binding schemes, logical and physical addresses are the same
In execution-time address-binding scheme, logical and physical addresses differ
Memory Management Techniques
-Fixed Partitioning
-Dynamic Partitioning
-Simple Paging
-Simple Segmentation
-Virtual Memory Paging
-Virtual Memory Segmentation
Fixed Partitioning
-Equal-size partitions
Dynamic Partitioning
-Partitions are of variable length and number
-Process is allocated exactly as much memory as required, no internal fragmentation
Problem: Eventually get holes in the memory. This is called external fragmentation
-Must use compaction to shift processes so they are contiguous and all free memory is in one block
Contiguous vs. Non-contiguous Memory Allocation
-The memory management techniques discussed so far all require the physical address space of a process to be contiguous
-Paging and Segmentation permit the physical address space of a process to be non-contiguous
Paging
-Partition memory into small equal fixed-size chunks and divide each process into the same size chunks
-The chunks of a process are called pages
-The chunks of memory are called frames