Assume \(N\) segments in memory and a page size of \(P\) bytes. The wastage on…
2009
Assume \(N\) segments in memory and a page size of \(P\) bytes. The wastage on account of internal fragmentation is :
- A.
\(NP/2\) bytes
- B.
\(P/2\) bytes
- C.
\(N/2\) bytes
- D.
\(NP\) bytes
Attempted by 3 students.
Show answer & explanation
Correct answer: A
In a segmentation-with-paging (hybrid) memory-management scheme, each segment is divided into fixed-size pages of P bytes. Internal fragmentation occurs only in the last page of each segment, because a segment's length is rarely an exact multiple of the page size — the unused tail of that last page cannot be allocated to any other process.
Let a segment's length modulo the page size P be the amount of content sitting in its last page — this remainder can be anywhere from 0 to P − 1 bytes.
Assuming these remainders are uniformly distributed over [0, P − 1], the average unused space in one segment's last page works out to (0 + (P − 1)) / 2, which is approximately P/2 bytes.
There are N segments in memory, and each one independently contributes this same average last-page loss.
Total expected internal-fragmentation wastage = N segments × P/2 bytes per segment = NP/2 bytes.
Unit check: N is a plain segment count and P is a byte quantity, so N × (P/2) comes out in bytes, matching how all four options are expressed. Boundary check: setting N = 1 reduces the formula to P/2 bytes — the standard one-segment result for the expected waste in a single last page — confirming the scaling to N segments is simply a multiplication by N.
So the wastage on account of internal fragmentation across N segments is NP/2 bytes.