Professional Documents
Culture Documents
OS Unit-III - Memory Management
OS Unit-III - Memory Management
MEMORY MANAGEMENT
Memory Management
To improve the performance of a computer, several processes
approaches
2. LOAD TIME
OS OS OS OS
1. First Fit
2. Best Fit
3. Worst Fit
enough.
Search the entire list, unless the list is kept ordered by size
approach.
03/10/2023 Unit III Memory Management
Fragmentation
Processes are loaded and removed from memory, the free
holes
fragmentation
physical memory
memory unit
03/10/2023 Unit III Memory Management
Paging
03/10/2023 Unit IV
1. SQL
Logical View of Segmentation
4
1
3 2
4
memory
segment limit
segment table
address space.
memory
1. Demand paging
2. Demand segmentation
Faster response
More users
03/10/2023 Unit III Memory Management
Demand Paging
Need some form of hardware support to distinguish between
pages that are in memory and pages that are on the disk
page table, will notice that the invalid bit is set, causing a
process
15 page faults
03/10/2023 Unit III Memory Management
Belady’s Anomaly
For some page-replacement algorithms, the page fault
increases.
Can vary by reference string: consider 1,2,3,4,1,2,5,1,2,3,4,5
Adding more frames can cause more page faults!
Belady’s Anomaly
of time
reference string
03/10/2023 Unit III Memory Management
Optimal Page Replacement
9 page faults
03/10/2023 Unit III Memory Management
LRU Page Replacement
Recent past is used as an approximation of the near future,
then replace the page that has not been used for the
that has not been used for the longest period of time
12 page faults
than executing
03/10/2023 Unit III Memory Management
Thrashing (Cont.)