What is Windows virtual memory allocation policy?

1

1

I set the size of the virtual memory to be managed by system. While there is ample space on the disk, I ran into the 'out of memory' error, contrary to my assumption that the system should just allocate more virtual memory in this case. So what is Windows automatic virtual memory allocation policy? Also does Windows require the memory used by a single process to be fit into the physical memory even if some threads are idle?

My problems is for Windows x64 in general (if it has to be specific, then it is Win 8.1, 16GB RAM, doing scientific computing).

EDIT: To be more specific, the softwares are MATLAB R2015a (win64) and Gurobi 6.0.5 (win64). Both of them had such errors in different cases. I don't think they have anything to do with 32-bit stuffs. Also I think the error simply means that the memory allocation function (say new or malloc) returns something invalid.

LeOpArD

Posted 2015-09-22T00:43:04.880

Reputation: 121

Is the process doing your calculations 32-bit or 64-bit? – misha256 – 2015-09-22T00:46:41.377

Everything is 64-bit – LeOpArD – 2015-09-22T00:48:52.040

Hmm, what kind of scientific application are you using? Does it have a name, version, or if it's something you wrote yourself, what language and compiler are you using? Also, do post a screenshot of the error you're getting, or more detailed error information if you can. We'll get to the bottom of this! ;-) – misha256 – 2015-09-22T01:26:56.230

"Out of memory" could be referring to virtual or physical memory or even swap space (what MS incorrectly labels "virtual memory"). You need to provide more details. See http://superuser.com/questions/748743/what-is-the-difference-between-virtual-memory-and-built-in-memory-ram/748776#748776

– sawdust – 2015-09-22T01:36:25.287

@sawdust Indeed. In fact, "out of memory" could mean virtually anything, especially if the error is being thrown by the application rather than the OS. I've seen an application say "Not enough RAM" because it (arbitrarily) couldn't handle more than 99 open files concurrently. That was clearly a limitation of the application, not of the system. And what a misleading error message! – misha256 – 2015-09-22T01:47:01.113

Answers

1

Most likely the process doing the calculations is in fact 32-bit. Such processes are limited to addressing a maximum of 2GB to 4GB, (depending on how the application is compiled) regardless of whether the OS is 32-bit or 64-bit.

If the application uses the .NET framework, other limitations come into play, even if the application is 64-bit. Unless you're purring away with .NET 4.5 or later that is.

Lastly, even pure 64-bit applications run into problems if they haven't been coded properly. I've seen 64-bit applications crash because, internally, they still work with 32-bit variables for things like indexes. When you push such an application too far (like try insert a 4,294,967,297th item) you get an inevitable crash, even though there's plenty of RAM to spare.

Here's some good documentation from MS on how Windows expands the page-file when necessary:

when the system commit charge is more than 90 percent of the system commit limit, the page file is increased to back it. This continues to occur until the page file reaches three times the size of physical memory or 4 GB, whichever is larger. This all assumes that the logical disk that is hosting the page file is large enough to accommodate the growth.

misha256

Posted 2015-09-22T00:43:04.880

Reputation: 10 292