All mock tests are FREE till 31 December — register to save your progress

Consider a machine with 16 GB of main memory and a 32-bit virtual address space, with page size 4 KB (frame size equals page size). If a process of size 34 KB is to be executed on this machine, what will be the size of internal fragmentation for this process?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. 2 KB

Explanation

Page size = 4 KB = 4096 bytes, and the process size is 34 KB = 34×1024 = 34816 bytes. The number of pages the process needs is ⌈34816/4096⌉ = ⌈8.5⌉ = 9 pages, so the OS actually allocates 9×4096 = 36864 bytes = 36 KB to it. Internal fragmentation is the unused space in the last allocated page: 36 KB − 34 KB = 2 KB, matching option (ii).

More Programming Languages and Computer Graphics questions