Content

  1. Introduction to Memory Management
  2. Managing Memory with Bitmaps & Lists
  3. Simple Memory Management & Fragmentation

Introduction to Memory Management

  • Requirements
    • Isolation
    • Abstraction
    • Sharing
  • Goals
    • Low memory overhead
    • Low performance overhead
  • Supports
    • Compiler
      • Source file to object file
      • Generates relocatable virtual memeory addresses
    • Linker
      • Links multiple object files to single program on disk
      • Generates absolute virtual memeory addresses
    • OS
      • Loads program into physical memory
      • Sets up virtual memory H/W
    • H/W
      • Translates virtual memory to physical memory
      • S/W too slow for address translation

Managing Memory with Bitmaps & Lists

  • After boot loader loads OS code & data in low memory, OS keeps track of allocated & free memory

  • Bitmap

    • 1 bit per chunk of memory; in use or not
    • Larger chunk size, lower overhead BUT more internal fragmentation

      |--OS code data--| bit map | chunk1 | chunk2 | ... |
                         01101...
      
  • Linked Lists

    • A list of elements for each allocated or free region of memory
    • Allocated bit + starting address + length + pointer

      | A |   f   |  B  | C | f |    D    | E | f | ... |
      
      | a | 0 | 5 | [] | --> | f | 5 | 3 | [] | --> ...
      
    • Searching

      • First fit
      • Best fit
      • Quick fit
  • Under which conditions is each approach preferable?

Simple Memory Management & Fragmentation

  • Internal fragmentation
    • Program doesn't use entire region -> paddings
  • External fragmentation
    • A large region cannot be allocated even enough memory exists
      • Compaction: move processes around, but expensive

results matching ""

    No results matching ""