# Summary ch8

1. Memory Management: Memory needs to be allocated to ensure a **reasonable supply of ready processes** to consume available processor time
2. Memory Management **Requirements**: &#x20;

   -**Protection**: Processes should not be able to reference memory locations in another process without permission &#x20;

   -**sharing**: Allow several processes to access the same portion of memory &#x20;

   -**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
3. Steps for loading a process in memory: &#x20;

   ![](https://1492199575-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lpv9LvE9HvRZfFprm8G%2F-Lpv9N-nJJPlGgPdEDsP%2F-Lpv9NzxnYa8Mwyk6UtU%2Fch8_01.png?generation=1569729390095720\&alt=media)
4. Address Binding &#x20;

   -Source program: **symbolic** (such as count) &#x20;

   -After compiling: **re-locatable address** &#x20;

   -After linkage editor, loader or run-time referring: **absolute address**

   ![](https://1492199575-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lpv9LvE9HvRZfFprm8G%2F-Lpv9N-nJJPlGgPdEDsP%2F-Lpv9NzzKQD9a7Ooqvmy%2Fch8_02.png?generation=1569729385200581\&alt=media)
5. Binding at Compile Time ![](https://1492199575-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lpv9LvE9HvRZfFprm8G%2F-Lpv9N-nJJPlGgPdEDsP%2F-Lpv9O-0gdW-ls_AZeCU%2Fch8_03.png?generation=1569729385220692\&alt=media)
6. 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\
   ![](https://1492199575-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lpv9LvE9HvRZfFprm8G%2F-Lpv9N-nJJPlGgPdEDsP%2F-Lpv9O-2F4uE_JA-tikh%2Fch8_05.png?generation=1569729385184798\&alt=media) ![](https://1492199575-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lpv9LvE9HvRZfFprm8G%2F-Lpv9N-nJJPlGgPdEDsP%2F-Lpv9O-4_sz9oai5ouIv%2Fch8_06.png?generation=1569729385478016\&alt=media)
7. Binding in execution time &#x20;

   Binding delayed until run time
8. Logical vs. Physical Address Space &#x20;

   The concept of binding a logical address space to a physical address space is central to proper memory management   &#x20;

   -**Logical address** – generated by the CPU; also referred to as virtual address   &#x20;

   -**Physical address**– address seen by the memory unit &#x20;

   In **compile-time** and **load-time address-binding** schemes, logical and physical addresses are the same  &#x20;

   In **execution-time** address-binding scheme, logical and physical addresses differ
9. Memory Management Techniques &#x20;

   -Fixed Partitioning &#x20;

   -Dynamic Partitioning &#x20;

   -Simple Paging &#x20;

   -Simple Segmentation &#x20;

   -Virtual Memory Paging &#x20;

   -Virtual Memory Segmentation &#x20;
10. Fixed Partitioning &#x20;

    -Equal-size partitions
11. Dynamic Partitioning &#x20;

    -Partitions are of variable length and number &#x20;

    -Process is allocated exactly as much memory as required, no internal fragmentation &#x20;

    **Problem**: Eventually get holes in the memory. This is called external fragmentation   &#x20;

    -Must use compaction to shift processes so they are contiguous and all free memory is in one block
12. Contiguous vs. Non-contiguous Memory Allocation &#x20;

    -The memory management techniques discussed so far all require the physical address space of a process to be **contiguous** &#x20;

    -Paging and Segmentation permit the physical address space of a process to be non-contiguous
13. Paging &#x20;

    -Partition memory into small equal fixed-size chunks and divide each process into the **same size** chunks &#x20;

    -The chunks of a process are called **pages** &#x20;

    -The chunks of memory are called **frames** &#x20;
