Search code examples
cachingvirtualvirtual-memorypage-tables

Calculate number of virtual pages per process


I have 64 KB of pages, 4GB physical memory, and a 64-bit machine.

I learnt that 64-bit machines result in 256TB of virtual memory. If I had to calculate the # of virtual pages per process, would that simply be:

Total virtual memory/ Page size = 256TB/64KB = 4x10^9 pages? I have read documentation online but I am not fully wrapping it.


Solution

  • All that means is that each process could theoretically have a logical address space of 2^64 bytes. Thus each process could theoretically have:

    2^64/2^16 = 2^48 pages

    In reality, it is effectively impossible for a process to have the maximum possible number of pages.

    The number of pages is restricted by:

    1. The division of the address space by mode.

    2. Page file size

    3. System parameters

    4. process quotas