70 likes | 87 Views
CSCI 6307 Foundation of Systems – Exercise (4). Xiang Lian The University of Texas – Pan American Edinburg, TX 78539 lianx@utpa.edu. Exercise.
E N D
CSCI 6307 Foundation of Systems – Exercise (4) Xiang Lian The University of Texas – Pan American Edinburg, TX 78539 lianx@utpa.edu
Exercise • Consider a swapping system in which memory consists of the following hole sizes in memory order: 600, 500, 1000, 503, 400, 1050, and 1600 bytes. Which block will be selected for successive requests of: • 500, 503, 100, 1003 using first-fit, best-fit, worst-fit, or next-fit policy.
Exercise • Consider decimal virtual addresses • 10000 • 23406 • 40000 • Compute the virtual page numbers and offsets with page size 4KB
Exercise • Suppose R= 3, 2, 4, 3, 4, 2, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 5, 6, 7, 2, 1 is a page reference stream. Given a page frame allocation of 3, and assuming the primary memory is initially unloaded, how many page faults will the given reference stream incur under: • FIFO • Belady’s optimal algorithm • LRU
FIFO 3 2 4 3 4 2 2 3 4 5 6 7 7 6 5 4 5 6 7 2 1 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 4 4 4 4 4 4 4
Belady’s Algorithm 3 2 4 3 4 2 2 3 4 5 6 7 7 6 5 4 5 6 7 2 1 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 4 4 4 4 4 4 4
LRU 3 2 4 3 4 2 2 3 4 5 6 7 7 6 5 4 5 6 7 2 1 3 3 3 3 3 3 3 3 3 2 2 2 2 2 2 2 2 4 4 4 4 4 4 4