Module_4_Memory Management
Module_4_Memory Management
Virtual Memory
Memory Management Strategies
Thrashing
Demand Segmentation
Contiguous Non-
Contiguous
p d
m-n n
Logical address 4
User’s view (1*4+0)
Physical address:
Run time address (6*4+0)=24
binding
Logical address 13
(3*4+1)
Physical address:
n=2 and m=4 32-byte
(2*4+1)
memory and 4-byte pages
Paging
• External fragmentation??
• Calculating internal fragmentation
• Page size = 2,048 bytes
• Process size = 72,766 bytes
• 35 pages + 1,086 bytes
• Internal fragmentation of 2,048 - 1,086 = 962 bytes
• So small frame sizes desirable?
• But increases the page table size
• Poor disk I/O
• Page sizes growing over time
• Solaris supports two page sizes – 8 KB and 4 MB
• User’s view and physical memory now very different
• user view=> process contains in single contiguous memory
space
• By implementation process can only access its own
memory
• protection
• Each page table entry 4 bytes (32 bits) long
• Each entry can point to 232 page frames
• If each frame is 4 KB
• The system can address 244 bytes (16TB) of physical
memory
Use’s view
System’s
view
RAM RAM
Before allocation After allocation
Implementation of Page Table
• For each process, Page table is kept in main memory
is needed ⇒ reference to it
⚫ invalid reference ⇒ abort
⚫ Page
1 ⇒ in-memory,
⚫ Witheach page table entry a valid−invalid bit is associated
0 ⇒ not-in-memory
fault.
03/05/2025 Subject_acronym:Module_No (roman): Module_Name 69