d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Paging Algorithms
12Next
Add Reply New Topic New Poll
Member
Posts: 9,805
Joined: Jul 8 2008
Gold: 9.00
Dec 8 2013 09:49pm
Need some help on my final assignment. Got in a motorcycle accident and missed a few class sessions so im behind.

Code
Use the programs in 3530fa13-memory-sim-distribution-131120.zip to analyze some paging algorithms.

Use two methods to generate page streams for this analysis:

The memory reference stream in the file spice.din
A randomly generated stream using the weights {50, 1, 1, 50}
Use the following parameters:

Execution time
Whatever the spice.din file provides
50000 page references for the randomly generated pages
Number of pages needed by the process: 32
Number of frames available for the process: 8
Compare the following page replacement algorithms in each case:

Optimal algorithm
LRU algorithm
Constant algorithm, always evicts the page in frame 0
Random algorith, evicts a randoly chosen page
For each combination of page generation method and algorithm do 5 runs. Collect the results and create a report based on these results.

The report should describe your findings, comparing the randomly generated page stream with the real memory stream and comparing the four algorithms. In support of your discussion, include at least the following:

A summary of the fault ratio for the eight different combinations of page generation method and page replacement algorithm. Use a table for this.
Give a one sentence description of the weights, what is the effect of using those weights?
Is this set of weights more realistic than the ones presented in class? You don’t have to present the data from class, but you should refer to it.
Deliverable

Turn in the report in an appropriate format. You do not have to submit the code.


if you can help i will provide the link to the code above :) ill pay all my fg and get more for you or whatever else you want.
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Dec 8 2013 10:01pm
what kind of help are you looking for? writing the code or writing the report based on your results?
Member
Posts: 9,805
Joined: Jul 8 2008
Gold: 9.00
Dec 8 2013 10:04pm
Quote (carteblanche @ Dec 9 2013 12:01am)
what kind of help are you looking for? writing the code or writing the report based on your results?


code looks complete there are some errors in it that i have emailed him about but writing the report would be where i need help. understanding the concepts would be a start and from there i could write the report once i figure out this code
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Dec 8 2013 10:08pm
How about you start by providing the table of results?
Member
Posts: 9,805
Joined: Jul 8 2008
Gold: 9.00
Dec 8 2013 10:11pm
Quote (carteblanche @ Dec 9 2013 12:08am)
How about you start by providing the table of results?


still trying to figure out the errors in this code. cant run it until i get these 2 errors resolved.

http://science.kennesaw.edu/~bsetzer/3530fa13/extra/examples/3530fa13-memory-sim-distribution-131120.zip

thats the code if you want it
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Dec 8 2013 10:31pm
I'm not gonna dig through the code to trouble shoot errors your prof put in there. After he resolves it, come back and post the results of the performance tests and we'll go from there.

In the meantime, check out wiki to try and familiarize yourself with them: http://en.wikipedia.org/wiki/Cache_algorithms
Member
Posts: 20,928
Joined: Mar 18 2009
Gold: 435,910.13
Dec 9 2013 04:28am
is this OS class?
LRU and optimal are pretty easy to understand

LRU = least recently used i.e replace the page that was used the earliest or "least recently"
optimal = replace the page that will not come into use for the longest time
other 2 looks like it already explains for you

basically because your memory is limited you have some pages in memory and some pages might exist in disk. If a process needs a page from disk it will
grab the page and replace 1 of the pages in memory

This post was edited by bakalolo on Dec 9 2013 04:37am
Member
Posts: 9,805
Joined: Jul 8 2008
Gold: 9.00
Dec 9 2013 12:11pm
Quote (bakalolo @ Dec 9 2013 06:28am)
is this OS class?
LRU and optimal are pretty easy to understand

LRU = least recently used i.e replace the page that was used the earliest or "least recently"
optimal = replace the page that will not come into use for the longest time
other 2 looks like it already explains for you

basically because your memory is limited you have some pages in memory and some pages might exist in disk.  If a process needs a page from disk it will
grab the page and replace 1 of the pages in memory


Ya Operating systems. if he doesnt email me back about fixing this code ill probably just BS the report. He is the easiest grader ive ever had.
Member
Posts: 9,805
Joined: Jul 8 2008
Gold: 9.00
Dec 9 2013 08:01pm
i got the code to work and im running the numbers now. had an emergency root canal today, kept me out for a little while
Member
Posts: 9,805
Joined: Jul 8 2008
Gold: 9.00
Dec 9 2013 08:35pm
Code
Spice.din Report:
Optimal - Page Requests: 10001000 PageFaults: 19338 Fault ratio: 0.00193361
Page Requests: 10001000 PageFaults: 19338 Fault ratio: 0.00193361
Page Requests: 10001000 PageFaults: 19338 Fault ratio: 0.00193361
Page Requests: 10001000 PageFaults: 19338 Fault ratio: 0.00193361
Page Requests: 10001000 PageFaults: 19338 Fault ratio: 0.00193361

LRU - Page Requests: 1000001 PageFaults: 26291 Fault ratio: 0.02629097
Page Requests: 1000001 PageFaults: 26291 Fault ratio: 0.02629097
Page Requests: 1000001 PageFaults: 26291 Fault ratio: 0.02629097
Page Requests: 1000001 PageFaults: 26291 Fault ratio: 0.02629097
Page Requests: 1000001 PageFaults: 26291 Fault ratio: 0.02629097

Constant- Page Requests: 1000001 PageFaults: 245529 Fault ratio: 0.24552875
Page Requests: 1000001 PageFaults: 245529 Fault ratio: 0.24552875
Page Requests: 1000001 PageFaults: 245529 Fault ratio: 0.24552875
Page Requests: 1000001 PageFaults: 245529 Fault ratio: 0.24552875
Page Requests: 1000001 PageFaults: 245529 Fault ratio: 0.24552875

Random - Page Requests: 1000001 PageFaults: 41051 Fault ratio: 0.04105096
Page Requests: 1000001 PageFaults: 40907 Fault ratio: 0.04090696
Page Requests: 1000001 PageFaults: 40974 Fault ratio: 0.04097396
Page Requests: 1000001 PageFaults: 41202 Fault ratio: 0.04120196
Page Requests: 1000001 PageFaults: 40807 Fault ratio: 0.04080696



Randomly generated stream Report:
Optimal - Page Requests: 50000 PageFaults: 519 Fault ratio: 0.010380
Page Requests: 50000 PageFaults: 507 Fault ratio: 0.010140
Page Requests: 50000 PageFaults: 496 Fault ratio: 0.009920
Page Requests: 50000 PageFaults: 536 Fault ratio: 0.010720
Page Requests: 50000 PageFaults: 528 Fault ratio: 0.010560

LRU - Page Requests: 50000 PageFaults: 836 Fault ratio: 0.016720
Page Requests: 50000 PageFaults: 759 Fault ratio: 0.015180
Page Requests: 50000 PageFaults: 744 Fault ratio: 0.014880
Page Requests: 50000 PageFaults: 784 Fault ratio: 0.015680
Page Requests: 50000 PageFaults: 764 Fault ratio: 0.015280

Constant- Page Requests: 50000 PageFaults: 10786 Fault ratio: 0.215720
Page Requests: 50000 PageFaults: 10423 Fault ratio: 0.208460
Page Requests: 50000 PageFaults: 10916 Fault ratio: 0.218320
Page Requests: 50000 PageFaults: 10102 Fault ratio: 0.202040
Page Requests: 50000 PageFaults: 10580 Fault ratio: 0.211600

Random - Page Requests: 50000 PageFaults: 952 Fault ratio: 0.019040
Page Requests: 50000 PageFaults: 903 Fault ratio: 0.018060
Page Requests: 50000 PageFaults: 1000 Fault ratio: 0.020000
Page Requests: 50000 PageFaults: 992 Fault ratio: 0.019840
Page Requests: 50000 PageFaults: 877 Fault ratio: 0.017540


That is the output of the code
Go Back To Programming & Development Topic List
12Next
Add Reply New Topic New Poll