Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Virtual memory infinite?

Tags:

memory

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 that in windows we do have a manual way to configure virtual memory to a certain limit.

I would like to know if Virtual memory is really Infinite?

like image 288
Amit Singh Tomar Avatar asked Jul 07 '11 10:07

Amit Singh Tomar


People also ask

Can you run out of virtual memory?

If your virtual memory runs low, you will encounter the following message: Your system is low on virtual memory. Windows is increasing the size of your virtual memory paging file. During this process, memory requests for some applications may be denied.

What is the maximum virtual memory?

The Maximum size is three (3) x the initial size. So let's say you have 4 GB (1 GB = 1,024 MB x 4 = 4,096 MB) of memory. The initial size would be 1.5 x 4,096 = 6,144 MB and the maximum size would be 3 x 6,144 = 18,432 MB."

Is virtual memory permanent or temporary?

Virtual memory uses both hardware and software to enable a computer to compensate for physical memory shortages, temporarily transferring data from random access memory (RAM) to disk storage.

What happens when virtual memory is full?

If your system has to rely too heavily on virtual memory, you will notice a significant performance drop. The key is to have enough RAM to handle everything you tend to work on simultaneously -- then, the only time you "feel" the slowness of virtual memory is is when there's a slight pause when you're changing tasks.


2 Answers

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

like image 179
stusmith Avatar answered Nov 08 '22 18:11

stusmith


If nothing else then virtual memory is going to be limited by the amount of disk space available, this sadly is far from infinite.

like image 41
Rob Avatar answered Nov 08 '22 19:11

Rob