1) When we talk about paging in Operating system or Computer Architecture,page size is always in power of 2.Why is it so ?

2) When we have external fragmentation,in order to combine all free space together we do compressing i.e merge all holes of main mamory together.
What disadvantages do we have by doing compression.Ofcourse one could be it will make speed slow of other running processes.What other disadvantages we will have becuase of compression?

2) When we have external fragmentation,in order to combine all free space together we do compressing i.e merge all holes of main mamory together.
What disadvantages do we have by doing compression.Ofcourse one could be it will make speed slow of other running processes.What other disadvantages we will have becuase of compression?

Thanks in advance.

Click to expand...

The idea of compression is that it prevents subsequent process loaded into memory from become fragmented so easily. Think about it, if you compress a series of processes you create a large contiguous block of free memory. If you now load a large process and data into memory, if you had not compressed the current set then this process and data would fragment - if you have compressed the current set then the process and data is less likely to fragment or will fragment into fewer blocks. It is obviously less of an issue for smaller processes and data sets.

Why is a fragmented set a problem? At the end of each fragment is pointer to the start of the next fragments - this is redundant data since it does not have anything explicitly important to the process or data. Then there is the switching overhead to the next fragment. These two factors compound to slow the execution down.