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
1

1 Answer 1

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.

4
  • Thanks for your response. Now I understand much better why I should enable it. After enabling the page file, windows still show Your computer is low of memory when the program launched. I guess it's lack of virtual memory ? Mar 14, 2016 at 10:16
  • @MincongHuang That's very unusual. Are the pagefile settings at their defaults or did you customize the size? Mar 14, 2016 at 10:20
  • It is defined dynamically by the system. However, as there're SQL Server running on localhost, it might have a really large I/O. This causes the commit charge at nearly 100%. So when visual studio launches, there's no capacity anymore. This why I receive the low of memory message. And it might be useless to increase the page file to 40GB. Mar 14, 2016 at 11:00
  • Why do you think it would be useless? Windows is telling you you're running out of commit limit. Increasing the size of your pagefile is one way to increase the commit limit. (And I would set the default size; do not rely on Windows automatic settings if you're having these issues. My rec for minimum/default pagefile size is large enough so that commit charge stays below 50% of the limit.) There are just two other possible ways to fix it: Add RAM; or run less stuff at one time. Jun 20, 2017 at 0:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .