Memory Management
Basic Memory Management
Logical vs. Physical Address Space
• The concept of a logical address space that is
bound to a separate 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
Basic Memory Management
Multiprogramming with Fixed Partitions
• Fixed memory partitions
• (a) separate input queues for each partition
• (b) single input queue
Basic Memory Management
Dynamic relocation using a relocation register
Swapping (1)
Schematic View of Swapping
Swapping (2)
• Memory allocation changes as
• processes come into memory
• leave memory
• Shaded regions are unused memory
• External Fragmentation – total memory space exists to satisfy a request, but it is
not contiguous
• Internal Fragmentation – allocated memory may be slightly larger than
requested memory; this size difference is memory internal to a partition, but
not being used
Fragmentation
5 P(x) = 13
External Fragmentation
10
\\\\\\\\\
1
\\\\\\\\\\
2 - 10
Internal Fragmentation 30 3 P=50
4
5
MM
Basic Memory Management
HW address protection with base and limit registers
Swapping (4)
Multiple-partition allocation
• Multiple-partition allocation
• Hole – block of available memory; holes of various size
are scattered throughout memory
• When a process arrives, it is allocated memory from a
hole large enough to accommodate it
• Operating system maintains information about:
a) allocated partitions b) free partitions (hole)
• There are two ways to keep track of memory usages
• Memory Management with Bit Maps
• Memory Management with Linked Lists
Memory Management with Bit Maps and Linked Lists
\\\\\\\\
allocated partitions (p)
free partitions (hole)
Bit Maps a[1000] : a[1] =0 ; a[2] =a[3]=1
a[3] ->a[101] = 0; a[101]->a[1000]=1 1
\\\\\\\\\\
a[i] in range(1000) 2
3 \\\\\\\\\\
101 \\\\\\\\\\
\\\\\\\\\\
1000 \\\\\\\\\\
MM
Linked Lists H.1.1 - P2.2 - H.3.98 - P1001.899
- Null