642 views

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.

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.

but how you get the formula ??

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

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

page size=p bytes

pte=e bytes     s=process size

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

### 1 comment

@Ramij check it

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