# Comparing the performance of different page replacement algorithms

Page 1 of 1

## 1 Replies - 1225 Views - Last Post: 19 November 2013 - 08:51 AM

### #1 blackvelvet

Reputation: 1
• Posts: 20
• Joined: 17-March 12

# Comparing the performance of different page replacement algorithms

Posted 19 November 2013 - 07:46 AM

So here is the problem statement...

Compare the performance of the following page replacement algorithms: FIFO, LRU (Least recently used), MRU (most recently used), and optimal. You will be provided with a file containing the virtual addresses that are being referenced by a single program (a process). Run your program with the following parameters:
Page size: 512, 1024, 2048 (words)
Number of frames allocated to the process: 4, 8, 12
(So you will have 9 runs, with each page size and number of frames combination. Each run contains statistics for each of the four page replacement algorithms. You must collect and print the following statistics
Page Size...#of pages...Page replacement ALG...Page fault percentage

So I understand how to do the page replacement algorithms on paper and find out how many page faults there are for each.
The file I'm provided with is a bunch of numbers (12, 5635, 1933, 8087, ... etc) on separate lines. Are those the different reference strings I'm suppose to use for each algorithm?

I understand what the frames are, but I don't understand what page size has to do with it?

Basically I know how to do the algorithms on paper with simple reference strings, but I can't quite wrap my head around what exactly my teacher is asking for here.
Any help is very appreciated. Thank you.

Is This A Good Question/Topic? 0

## Replies To: Comparing the performance of different page replacement algorithms

### #2 dbasnett

Reputation: 114
• Posts: 626
• Joined: 01-October 08

## Re: Comparing the performance of different page replacement algorithms

Posted 19 November 2013 - 08:51 AM

The numbers represent an address that has to be mapped to a page and offset. If your page size is 512 with the first page loaded into one of the frames, and the numbers in the file are 0,1,2,...,511,512, then a page fault won't happen until 512.

I guess that the numbers are arranged to cause predetermined statistics.

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }