Chapter 7 Memory Management Basic requirements of Memory Management Memory Partitioning Basic blocks of memory management Paging Segmentation
1 Chapter 7 Memory Management • Basic requirements of Memory Management • Memory Partitioning • Basic blocks of memory management – Paging – Segmentation
The need for memory management Memory is cheap today, and getting cheaper But applications are demanding more and more memory, there is never enough Memory Management involves swapping blocks of data from secondary storage Memory /o is slow compared to a CPu The os must cleverly time the swapping to maximise the CPUs efficiency
2 The need for memory management • Memory is cheap today, and getting cheaper – But applications are demanding more and more memory, there is never enough! • Memory Management involves swapping blocks of data from secondary storage. • Memory I/O is slow compared to a CPU – The OS must cleverly time the swapping to maximise the CPU’s efficiency
Memory Management A program must be loaded into main memory to be executed Memory needs to be allocated to ensure a reasonable supply of ready processes to consume available processor time otherwise, for much of the time all of the processes will be waiting for l/ 0 and the processor W‖ i be idle
3 Memory Management Memory needs to be allocated to ensure a reasonable supply of ready processes to consume available processor time – Otherwise, for much of the time all of the processes will be waiting for I/O and the processor will be idle. A program must be loaded into main memory to be executed
Memory Management Requirements ·Re| ocation Protection Sharing Logical organisation Physical organisation
4 Memory Management Requirements • Relocation • Protection • Sharing • Logical organisation • Physical organisation
REquirements: Relocation The programmer does not know where the program will be placed in memory when it is executed it may be swapped to disk and return to main memory at a different location(relocated But, os knows because it is managing memory and is responsible for bringing this process into main memory
5 Requirements: Relocation • The programmer does not know where the program will be placed in memory when it is executed, – it may be swapped to disk and return to main memory at a different location (relocated) • But, OS knows because it is managing memory and is responsible for bringing this process into main memory