Is Virtual memory infinite?

前端 未结 6 1803
误落风尘
误落风尘 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:31

    At the very least, the size of virtual memory is limited by the size of pointers on given platform (unless it has near/far pointers and non-flat memory model). For example, you cannot address more than about 2^32 (4GB) of memory using single 32-bit pointer.

    In practice, the virtual memory must be backed up with something eventually -- like a pagefile on disk -- so the size of storage enforces a more practical limit.

提交回复
热议问题