Sukalyan Sen
Sukalyan Sen

Reputation: 33

When is it advantageous to define virtual memory smaller than physical memory?

Generally as we know virtual memory is larger than physical memory.But when is it advantageous to define virtual memory smaller than physical memory?

Upvotes: 1

Views: 1013

Answers (2)

user3344003
user3344003

Reputation: 21607

Imagine a large server system supporting multiple users. You don't want users to hog memory, so you restrict the size of the logical (virtual) address space by limiting page table size.

Upvotes: 0

nwellnhof
nwellnhof

Reputation: 33618

If you have pointer-heavy code, you can save memory by choosing a smaller address space. For example, a pointer on a 32-bit platform occupies 4 bytes versus 8 bytes on 64-bit. The same goes for integer types like size_t.

This only works and makes sense if:

  • Your code/application/server uses multiple processes and all processes together need more memory than the amount of virtual memory (otherwise you wouldn't need more physical than virtual memory).
  • Your platform supports more physical than virtual memory (for example, Intel PAE).
  • The smaller amount of virtual memory is enough for each single process.

Upvotes: 1

Related Questions