in Operating System edited by
642 views
0 votes
0 votes

in Operating System edited by
by
642 views

4 Comments

@adarsh_1997 explain please

0
0

My approach was:

Assuming Optimal page size be x.

Total number of pages =$\frac{32 * 2^{20}}{x}$

No fo pages *Size of each entry of page = Page table size

we have to fit entire page table in one page

=>$\frac{32 * 2^{20}}{x} * 4 = x$ 

=>$x^2 = 2^{27}$

=>$x=(134217728)^{1/2} $

=>$x=11585.2375$Bytes

=>$x=11.31KB$ 

=>$x=12KB$

Please correct me.. where I went wrong.

0
0

@Hemanth_13 check my answer.

0
0

3 Answers

2 votes
2 votes
Best answer

Optimal page size=√(2*S*E)

where S=process size and E= Table entry size

so for given instance S=32MB=2^25 Byte

E=4B=2^2

so optimal size=√(2*(2^25)*(2^2)

=2^14

=2^4 KB

=16KB

so 16 should be ans.

 

selected by

2 Comments

but how you get the formula ??
0
0

On an average due to internal fragmentation P/2 is wasted and for Page table overhead=(S/P)*E where S is process size and P is page size and E is table enry size

total overhead=P/2  + (S/P)E

to get minimal value differentiate w,r,t P equate it to 0 you will get P=√(2*S*E)

1
1
1 vote
1 vote
page size=p bytes

pte=e bytes     s=process size

overheads=p/2 + (s/p)* e

for minimal overhead   d(overhead)/d(p)=0  

p^2=2se=2*2^25*4=2^28    so p=2^14B=16KB

1 comment

@Ramij check it

0
0
1 vote
1 vote
Given, Process size =32 MB = 2^25 B

PTE= 4 B = 2^2 B.

For minimizing total overload due to page table and internal fragmentation

Page size >= Page table size.

Let page size be p

We know that, Page table size= no. Of pages * PTE

So, p >= (2^25)/p * 2^2 B

p^2 >= 2^27 B

p >= 2^(27/2) B

So, p min will be 2^14 B = 16 KB

Related questions