CS FundamentalsHardGATE CS (PYQ pattern)

A 32-bit machine has 512 MB of RAM, of which the resident kernel permanently uses 128 MB, and a 1 GB swap partition. The top 1 GB of every process's 4 GB virtual address space is reserved for the kernel. The OS never overcommits: every virtual page a process allocates must be backed at allocation time by a free RAM frame or a free swap slot. With no other process running, what is the largest amount of memory one process can allocate?

  1. A. 1408 MB
  2. B. 3 GB
  3. C. 1536 MB
  4. D. 4 GB

Correct answer: A. 1408 MB

Two limits apply and the smaller wins. Address space: 4 GB - 1 GB kernel = 3 GB of user addresses. Backing store: (512 - 128) MB of RAM + 1024 MB of swap = 1408 MB. Since every allocated page needs a frame or a slot, the process can allocate at most min(3 GB, 1408 MB) = 1408 MB. 1536 MB forgets the kernel's RAM; 3 GB and 4 GB ignore the backing limit.

More Operating Systems questions

Exams that ask this topic