0

I'm using a windows 7 Pro for development related to SQL Server. And I've received an exception of out of memory in Visual Studio 2010 :

Microsoft Visual Studio is unable to load this document:
Exception of type 'System.OutOfMemoryException' was thrown.

And here's the memory status :

Memory status

I estimate that my task requires less then 1 GB of memory. However, it still failed. I don't know where the problem comes from. I receive low memory alert when the memory used reaches 4 GB. And here's more detail

  • The virtual memory is disabled. (Previously more than 21GB used)
  • There're 3 memory chips of 4GB
Mincong Huang
  • 135
  • 2
  • 7

1 Answers1

3

The out of memory error you are getting is not out of physical memory, it's out of backed virtual memory.

You cannot disable virtual memory in Windows. What you mean is that you have no page file, which means the only backed virtual memory you have is RAM, and that's likely not enough.

So ... you need a paging file. It doesn't matter how much RAM you have, you can't make efficient use of that RAM without a paging file. There are other answers all over the Internet that explain this in detail. Here is one place where I explained it.

What's happening is that while lots of RAM is free, it's also reserved. For example, say I ask the operating system to allocate 1GB for me. No RAM is required for this allocation because I haven't stored anything yet. But without a paging file, 1 GB of RAM has to be reserved because I've already allocated it.

In a typical, modern system, lots of things reserve memory that they wind up never using. A paging file allows the operating system to continue to allow these allocations because on the off chance everything does get used later, the system can use the paging file to keep its promises.

Also, this question is nearly identical.