0

Doing copy/paste in Visual Studio 2010 RTM on Windows 7, 3GB ram machine, I was unable to copy text because of an error:

Memory cap

Task Manager shows that devenv.exe is using a little more than 500MB. However I still have almost 1GB of free RAM available.

Is that somekind of memory cap? If so, is there a way to increase it? It may be a bug, but maybe there is a workaround?

Janis Veinbergs
  • 1,545
  • 4
  • 23
  • 34
  • 64bit might help, it is usually hard to free adddress space (by remaping DLLs for example). – eckes Dec 13 '12 at 02:35

2 Answers2

1

This article explains that the problem is that each app on your machine will be allocated 4GB of address space - 2GB assigned to the app and a shared 2GB space assigned to the Kernel that all apps share.

Address space is only allocation in contiguous blocks, so if you need 1mb of space, it needs to find a contiguous 1mb space for you (as opposed to 2 500kb spaces). As you use this space, it becomes fragmented, and eventually you may find that there isn't enough contiguous space for your needs - it hints that this is more likely to be in the kernel space than in your app space.

Your fragmentation errors are likely to be because something is requiring a contiguous amount of address space which is greater than the largest block available.

Solutions: Er... none that I know of, or that I've read about. You really need to try and identify the culprit(s). If it is a 3rd party app, don't use it - if it is your application, make sure that when you use space you use it in smaller blocks, and make sure you don't have any leakage.

Not very helpful, I realise...

Another useful article...

CJM
  • 730
  • 2
  • 12
  • 28
  • I can copy paste in other apps, but not in Visual Studio... err. Thanks for the lesson. – Janis Veinbergs Apr 16 '10 at 11:14
  • I restarted VS and its ok at the moment, however i thought i could do something to prevent this stuff happening further. – Janis Veinbergs Apr 16 '10 at 11:25
  • It's hard to say... it might not be VS that is causing the problem. I can see VS being more demanding regarding memory than other applications, but in my experience, it is fairly well behaved. I usually have several copies open at any one time... – CJM Apr 16 '10 at 15:15
  • 1
    See my answer linked below for how windows memory works, CJM is correct- something is probably chopping up the memory space. http://serverfault.com/questions/74822/how-do-i-tell-if-my-windows-server-is-swapping – Jim B Apr 16 '10 at 15:57
1

Additionally, if you have multiple pages open in VS2010 try closing some of them, then minimize (not close) visual studio then re-maximize. This will release the memory once VS has lost focus.

FYI, the minimize trick works on my applications, such as Firefox or Outlook.

SQL Ninja
  • 11
  • 1