03 OS - Memory Management
03 OS - Memory Management
MANAGEMENT
VICTORIA KIRSTEN SISON
DARLY V. BUEN
ANDREA NICOLE B. QUERUBIN
MIRIVA INDIA V. SISON
Introduction
• T
› he functionality of an operating system which handles
or manages primary memory and moves processes back
and forth between main memory and disk during
execution.
• M
emory management keeps track of each and every
memory location, regardless of either it is allocated to some
process or it is free. It checks how much memory is to be
allocated to processes. It decides which process will get
memory at what time. It tracks whenever some memory
gets freed or unallocated and correspondingly it updates
the status.
Key Players in Memory Management
• Compiler
⚬ structures the address space of an application
• OS
⚬ maps the compiler’s structures onto the hardware
• Hardware
⚬ performs the actual accesses to memory locations
Process Address Space
• Static loading
⚬ the absolute program (and data) is loaded into
memory in order for execution to start.
• Dynamic loading
⚬ dynamic routines of the library are stored on a
disk in relocatable form and are loaded into
memory only when they are needed by the
program.
Swapping
⚬ Low Memory
■ Operating system resides in this memory.
⚬ High Memory
■ User processes are held in high memory.
Memory Allocation Mechanism
• Single-partition allocation
⚬ relocation-register scheme is used to protect user
processes from each other, and from changing
operating-system code and data.
• Multiple-partition allocation
⚬ main memory is divided into a number of fixed-
sized partitions where each partition should contain
only one process.
Fragmentation
• External fragmentation
⚬ Total memory space is enough to satisfy a
request or to reside a process in it, but it is not
contiguous, so it cannot be used.
• Internal fragmentation
⚬ Memory block assigned to process is bigger. Some
portion of memory is left unused, as it cannot be
used by another process.
Paging