in Operating System recategorized by
12,388 views
51 votes
51 votes

The address sequence generated by tracing a particular program executing in a pure demand based paging system with $100$ records per page with $1$ free main memory frame is recorded as follows. What is the number of page faults?

$0100, 0200, 0430, 0499, 0510, 0530, 0560, 0120, 0220, 0240, 0260, 0320, 0370$

  1. $13$
  2. $8$
  3. $7$
  4. $10$
in Operating System recategorized by
12.4k views

3 Comments

when new range address come then fault occur otherwise  hit

Address Range   [X.00 to X.99]  {X=1,2,3,4,5}

1. 100 -> range [100,199] =  fault

2. 200 -> range [200, 299] =  fault

3. 430 -> range [430 , 529] =  fault

4. 499 -> prev frame =  hit

5. 510 -> prev frame = hit

6. 530 -> range [530 , 629] -=fault

7. 560 -> prev frame = hit

8. 120 -> range [120 , 219] = fault

9. 220 -> range [220 , 319] = fault

10. 240 -> prev frame = hit

11. 260 -> prev frame = hit

12. 320 -> range [320 , 419] = fault

13. 370 -> prev frame = hit

Therefore, total fault =7

0
0
I think this is not the correct approach here, this was valid for the more recent gate question in which it was mentioned if page fault occurs for page x then we bring upto x+99 frames in the memory.

I think here we will always bring 0-99 frames like (100-199), (200-299) etc
1
1

@abhineet

your method fail here https://gateoverflow.in/3445/gate2007-it-12

, i say dynamic frame x.00 to x.99 may be x.199[it depends on address range ] so  we  go according to  Q 

 

 

0
0

4 Answers

60 votes
60 votes
Best answer
  • $0100 - 1$ page fault. Records $0100-0199$ in memory
  • $0200 - 2$ page faults. Records $0200-0299$ in memory
  • $0430 - 3$ page faults. Records $0400-0499$ in memory
  • $0499 - 3$ page faults. Records $0400-0499$ in memory
  • $0510 - 4$ page faults. Records $0500-0599$ in memory
  • $0530 - 4$ page faults. Records $0500-0599$ in memory
  • $0560 - 4$ page faults. Records $0500-0599$ in memory
  • $0120 - 5$ page faults. Records $0100-0199$ in memory
  • $0220 - 6$ page faults. Records $0200-0299$ in memory
  • $0240 - 6$ page faults. Records $0200-0299$ in memory
  • $0260 - 6$ page faults. Records $0200-0299$ in memory
  • $0320 - 7$ page faults. Records $0300-0399$ in memory
  • $0370 - 7$ page faults. Records $0300-0399$ in memory

So, (C) - $7$ page faults.

edited by
by

4 Comments

Hey, I don't understand it.

What is the reason @confused_luck 's method is wrong. Could you please suggest some resource of your point?
0
0

can anyone clarify whatevere @confused_luck has written , i think it is wrong.

0
0

See the difference between this 1995 and 2007 question(https://gateoverflow.in/3445/Gate-it-2007-question-12)

In 2007, it is specially written to load (x,x+99) memory when address x is referenced.

Normally, we take fixed size pages starting at address 0. In this 1995 question nothing is mentioned about how memory is loaded after reference, we should take page aligned memory(pages are stored at address multiple of page size), and every reference will fetch whole page(page which is stored at addresses multiple of page size)

So taking page aligned memory, Assuming(page size =100)  page 0(0-99) , page 1(100-199)…

we get 7 page fault as explained in above ans

Coincidentally, like in 2007 question, taking page starting at referenced address(as given in 2007 question), in this question also we are getting 7 page fault. But we not always assume that unless specified.

See the comment by @chirudeepnamini

PS: Good read in alignment https://www.geeksforgeeks.org/structure-member-alignment-padding-and-data-packing/

https://gateoverflow.in/640/Gate-cse-2000-question-1-17-isro2015-79

 

1
1
9 votes
9 votes
page are fitted in frames ,so first we need to determine the pages but given request are just the record request in decimal.we can assume that first page to address from 0000 to 0099 and page 2 contains records from 0100 to 0199 and so on(it is given in question that each page contains 100 records) and so on.sso page reqquest string is 01,02,04,04,05,05,05,01,02,02,02,03,03 clearly 7 page fault.

2 Comments

this is very clear and right answer i think
1
1
Beautiful!
0
0
6 votes
6 votes

Since no of record in each page is 100 try to normalize the given value.

normalized value for each record is given by floor( given value /100 ) 

so you will get 01,02,04,04,05,05,05,01,02,02,02,,03,03 

you can remove 0 from prefix if you love to remove .

now easily we can get 7 as total page fault.

0 votes
0 votes

one page contain =100 record mean(0-99) record,AND ALL THAT..

RECORD RANGE FRAME NUMBER
0-99         0
100-199         1
200-299         2
300-399         3
400-499         4
500-599         5

 

USING THE GIVEN TABLE WE WRITE STRING=1,2,4,4,5,5,5,1,2,2,2,3,3

        1 FRAME IS GIVEN    

        PAGE FAULTS STRING ARE=1,2,4,5,1,2,3

        TOTAL PAGE FAULTS=7

 

Answer:

Related questions