This problem studies the effect of changing page sizes in a demand paging system. The following sequence of requests for program words is taken from a 460-word program: 10, 11, 104, 170, 73, 309, 185,245,246,434,458, and 364. Main memory can hold a total of 200 words for this program, and the page frame size will match the size of the pages into which the program has been divided. Calculate the page numbers according to the page size; divide by the page size, and the quotient gives the page number. The number of page frames in memory is the total number, 200, divided by the page size. For example, in problem (a) the page size is 100, which means that requests 10 and 11 are on Page 0, and requests 104 and 170 are on Page 1. Therefore, the number of page frames is two. a.) Find the success frequency for the request list using a FIFO replacement Algorithm and a page size of 100 words (there are two page frames). b.) Find the success frequency for the request list using a FIFO replacement Algorithm and a page size of 20 words (10 pages, 0 through 9). c.) Find the success frequency for the request list using a FIFO replacement Algorithm and a page size of 200 words. d.) What do your results indicator ''Can you make any general statements about what happens when page sizes are halved or doubled? e.) Are there any overriding advantages in using smaller pages? What are the offsetting factors? Remember that transferring 200 words of information takes less than twice as long as transferring 100 words because of the way secondary storage devices operate (the transfer rate is higher than the access, or search/find, rate). f.) Repeat (a) through (c) above, using a main memory of 400 words. The size of each page frame will again correspond to the size of the page. g.) What happened when more memory was given to the program? Can you make some general statements about this occurrence? What changes might you expect to see if the request list was much longer, as it would be in real life? . h.) Could this request list happen during the execution of a real program? Explain. i.) Would you expect the success rate of an actual program under similar conditions to be higher or lower than the one in this problem? Using the programming environment of your choice, (OS, language, etc.), please do the assignment above. Please submit all files via the submission folder provided.
This problem studies the effect of changing page sizes in a demand paging
system. The following sequence of requests for program words is taken from a
460-word program: 10, 11, 104, 170, 73, 309, 185,245,246,434,458, and
364. Main memory can hold a total of 200 words for this program, and the
page frame size will match the size of the pages into which the program has
been divided.
Calculate the page numbers according to the page size; divide by the page size,
and the quotient gives the page number. The number of page frames in memory
is the total number, 200, divided by the page size. For example, in problem (a)
the page size is 100, which means that requests 10 and 11 are on Page 0, and
requests 104 and 170 are on Page 1. Therefore, the number of page frames is
two.
a.) Find the success frequency for the request list using a FIFO replacement
b.) Find the success frequency for the request list using a FIFO replacement
Algorithm and a page size of 20 words (10 pages, 0 through 9).
c.) Find the success frequency for the request list using a FIFO replacement
Algorithm and a page size of 200 words.
d.) What do your results indicator ''Can you make any general statements about
what happens when page sizes are halved or doubled?
e.) Are there any overriding advantages in using smaller pages? What are the
offsetting factors? Remember that transferring 200 words of information
takes less than twice as long as transferring 100 words because of the
way secondary storage devices operate (the transfer rate is higher than the
access, or search/find, rate).
f.) Repeat (a) through (c) above, using a main memory of 400 words. The size
of each page frame will again correspond to the size of the page.
g.) What happened when more memory was given to the program? Can you
make some general statements about this occurrence? What changes might
you expect to see if the request list was much longer, as it would be in real life?
.
h.) Could this request list happen during the execution of a real program?
Explain.
i.) Would you expect the success rate of an actual program under similar
conditions to be higher or lower than the one in this problem?
Using the
Solution:
The problem is related to demand paging, where the demand for a particular memory page is fulfilled only when a page fault occurs. The goal is to calculate the success frequency of the page requests for different page sizes, using a FIFO replacement algorithm.
a) Using a FIFO replacement algorithm and a page size of 100 words, there are 2 page frames available for this program. Calculating the page numbers for each request, we get:
- Request 10: Page 0
- Request 11: Page 0 (page already in memory)
- Request 104: Page 1
- Request 170: Page 1 (page already in memory)
- Request 73: Page 0 (page already in memory, page 1 gets replaced)
- Request 309: Page 3
- Request 185: Page 1 (page already in memory, page 0 gets replaced)
- Request 245: Page 2
- Request 246: Page 2 (page already in memory)
- Request 434: Page 4
- Request 458: Page 4 (page already in memory)
- Request 364: Page 3 (page already in memory, page 2 gets replaced)
The success frequency is 7 out of 12 requests or approximately 58.3%.
b) Using a FIFO replacement algorithm and a page size of 20 words, there are 23 page frames available for this program. Calculating the page numbers for each request, we get:
- Request 10: Page 0
- Request 11: Page 0 (page already in memory)
- Request 104: Page 5
- Request 170: Page 8
- Request 73: Page 3
- Request 309: Page 15
- Request 185: Page 9
- Request 245: Page 12
- Request 246: Page 12 (page already in memory)
- Request 434: Page 21
- Request 458: Page 22
- Request 364: Page 18
The success frequency is 3 out of 12 requests, or approximately 25%.
c) Using a FIFO replacement algorithm and a page size of 200 words, there is only 1 page frame available for this program. Calculating the page numbers for each request, we get:
- Request 10: Page 0
- Request 11: Page 0 (page already in memory)
- Request 104: Page 0 (page already in memory)
- Request 170: Page 0 (page already in memory)
- Request 73: Page 0 (page already in memory)
- Request 309: Page 1
- Request 185: Page 0 (page already in memory)
- Request 245: Page 1 (page already in memory)
- Request 246: Page 1 (page already in memory)
- Request 434: Page 2
- Request 458: Page 2 (page already in memory)
- Request 364: Page 1 (page already in memory, page 2 gets replaced)
The success frequency is 6 out of 12 requests or approximately 50%.
d) When the page size is halved, the number of pages in the program doubles, resulting in more page faults due to fewer pages being available in memory. Conversely, when the page size is doubled, the number of pages in the program halves, resulting in fewer page faults due to more pages being available in memory.
e) Smaller page sizes allow for more efficient use of memory, as only the necessary pages are loaded into memory rather than entire blocks of data. This can lead to less wasted memory and faster program execution times. However, smaller page sizes also increase the likelihood of page faults, which can decrease overall program performance.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps