Modeling Page Replacement Algorithms
Belady’s Anomaly Reference Pages: 0 1 2 3 0 1 4 0 1 2 3 4
Belady’s Anomaly
Stacks Algorithms Definisi dari Stack Algoritm ? Contoh: Reference String terdiri dari 4 Pages: 0 2 1 3 5 4 6 3 7 4 7 3 3 5 5 3 1 1 1 7 2 3 4 1 Reference String terdiri dari 5 Pages:
Memprediksi Page Fault Rates
Memprediksi Page Fault Rates
Distance String
Isu Perancangan untuk Sistem Paging Local Vs Global Allocation Policies
Page Fault Rates
Page Size Want to set page size to reduce internal fragmentation Smaller page size leads to more pages leads to larger page table What is optimal page size? p = page size = ? s = average process size, e = size of each page table entry s/p = average number of pages per process (s/p)*e = space taken up by average process in page table p/2 = average wasted memory in last page of process due to internal fragmentation overhead = (s/p)*e + p/2 Find optimal page size by taking derivative and setting to 0 p = 2se
Process with a subset of pages in main memory
Swap out area disk image of the logical address spaces of a process
Isu Implementasi Tahapan Page Fault Handling Locking Pages in Memory Backing Store
Handling a Page Fault
Segmentation
Segmentation
Segmentation
Segmentation
Latihan Hitung jumlah page fault jika diketahui Reference String sbb:, dan memori terdiri dari 4 Pages: 0 2 1 3 5 4 6 3 7 4 7 3 3 5 5 3 1 1 1 7 2 3 4 1 Dengan algoritma: FIFO LRU Optimal