Professional Documents
Culture Documents
MANAGEMENT
OPERATING SYSTEM
Virtual Memory
The main idea behind virtual memory is
to allow a combination of program, stack
and data to run on a smaller memory by
carefully choosing which part of the
process is to be placed in the physical
memory.
CONCEPT OF LOCALITY
The principle of locality states that
program and data references within a
process tend to cluster.
Spatial Locality
A[0][1], A[0][2], A[0][3]
A[1], A[2], A[3]
PAGING
The idea is to divide the memory into
frames where programs can reside. The
programs, on the other hand, are divided
into equal sized pages. In this technique,
logical address is divided into a Page
Number and a Page Offset.
Conversion Process
Paging
Partition memory into small equal fixed-
size chunks and divide each process into
the same size chunks
The chunks of a process are called pages
and chunks of memory are called frames
Operating system maintains a page table
for each process
Contains the frame location for each page in
the process
Memory address consist of a page number
and offset within the page
15
Paging Formula
p = U div P Where:
P = page size
d = U mod P V = physical address
U = logical address
U=p*P+d p = page number
f = frame number
V=f*P+d d = displacement
Paging Example
Page # Frame #
19
Paging Example
Page # Frame #
20
Paging Example
Page # Frame #
Page 2 Frame 2
Page 3 Frame 3
Frame 4
35
Logical View of Segmentation
1
1 4
3
4
2
37
Page entry is invalid; Page is not available in memory
(RAM)
Page fault occurs.