Professional Documents
Culture Documents
C R Sarma
Associate Professor, Dept of ECE
G.Narayanamma Institute of Technology and Science
10/15/98 1
MEMORY MANAGEMENT
– Memory Management earlier responsibility
of the Operating System
– Microprocessors now support part of these
functions
– efficient usage main memory
– Protecting processes address space
– logical or virtual address space address
– Hides low level details
2
Two types of Address Space
1 Physical store (space): the hardware memory on
the machine
2 Virtual (or logical) address space: the
memory perceived by a process. Each process has its
own virtual space.
• Criteria
1 How efficiently can it be implemented?
2 How effectively can the physical memory
be utilized?
8
Fixed Partitions-1
1 Divide all physical memory into a fixed set
of contiguous partitions.
E.g., early IBM 360 models.
+---------+
| monitor |Queue for waiting processes
+---------+
| 2K | ....
+---------+
| 6K | ....
+---------+
| 12K | ....
+---------+
9
Fixed Partitions-2
2 Place only one process at a time
3 Bind physical to virtual address during
loading, not during execution.
4 Partition boundaries limit the length of
virtual memory for each process.
5 A process entirely in main memory or
entirely on backing store (i.e., swapped in
or swapped out).
10
Fixed Partitions-3
• Two operations:
• RequestMemory (size, baseAddr)
• ReleaseMemory (size, baseAddr) 12
Allocation strategies
Let {Hi | i = 1,…,n} be a set of unused
holds and k be the size of a
requested block.
• First-Fit :Select the first Hi such that
size (Hi) ≥ k.
14
Segmentations
BASE(B15-B8) BASE(B7-B0)
LIMIT(L15-L8) LIMIT(L7-L0)
16
Segmentation - Microprocessor
support
Selector Offset
Memory
+ operand
17
Paging
Paging solves placement problem -uses equal
size blocks of physical memory - page frames
Page fault i- referencing a page - not loaded -
page frame.
Replacement strategies needed- some pages
must be swapped out
Goal: minimize the number of page faults.
Demand paging: bring in a page when it is
needed (detected by a page fault).
Prefetching: bring in a set of pages before
starting or restarting after a long I/O or
scheduling block.
Clustering: bring in several pages at a time
(demand paging).
18
Paging Hardware
19
Page Fault Handling
20