Is Virtual memory infinite?

前端 未结 6 1885
误落风尘
误落风尘 2021-01-31 12:02

I have been asked in an interview if virtual memory is infinite? I answered saying that it is not infinite. Then the interviewer asked the explanation and what I suggested was t

6条回答
  •  你的背包
    2021-01-31 12:29

    First of all, forget the idea that virtual memory is limited by the size of pointers on your machine.

    Virtual memory limits are not the same as addressing space. You can address more virtual memory than is available in your pointer-based address space using paging.

    • Virtual memory upper limits are set by the OS: for example, on 32-bit Windows the limit is 16TB, and on 64-bit Windows the limit is 256TB.
    • Virtual memory is also physically limited by the available disc space.

    For an excellent overview, which addresses various misconceptions, see the following:

    http://blogs.msdn.com/b/ericlippert/archive/2009/06/08/out-of-memory-does-not-refer-to-physical-memory.aspx

提交回复
热议问题