Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Many of my application are appearing to not be able to allocate memory. This ranges from missing buttons/toolbars in explorer, other apps not starting at all, etc. WinSCP actually gives the most detailed error message:

Error reading ListingCommandEdit->Items.Strings: System Error. Code: 8. Not enough storage is available to process this command.

The latter text is the generic error text for the system error ERROR_NOT_ENOUGH_MEMORY. Now here's the problem: I have plenty of memory.

Popping up Process Explorer reveals 650 MB of free RAM, and another 200 MB in cache. The pagefile has another 1.5 GB according to Process Explorer. The disk holding the pagefile (C:) has 137 GB of free space.

My next thought was handles: perhaps there's a limit there? I have 30k of them, again, according to PE, but a quick test app says I can allocate at least another 30k.

So... what exactly am I out of? Yes, there's a lot running, but if I have the resources available for more, then I don't expect to see errors.

share|improve this question
1  
"Spurious of out memory"? Somehow I think you meant "Spurious out of memory"… –  Hello71 Aug 4 '10 at 15:10
    
Somehow I think you might be right. Thanks! –  Thanatos Aug 11 '10 at 4:48
add comment

2 Answers

up vote 3 down vote accepted

Apparently, Windows has something called a "Desktop Heap", which is by default 3 MiB. Information on things such as HWNDs (windows, buttons, text, edit boxes, check boxes, radio buttons, you name it) are stored here - if you exhaust this, you can't create any more Windows, and thus things stop running.

This is a set limit - nothing useful like it expanding the heap happens. Thankfully, it's reconfigurable, at the cost of a reboot. It's a registry tweak to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems\Windows.

If you need to know if this is what is affecting you, get the dheapmon tool from Microsoft, available here:

http://www.microsoft.com/downloads/details.aspx?familyid=5cfc9b74-97aa-4510-b4b9-b2dc98c8ed8b&displaylang=en

A better article on how to run it:

http://blogs.msdn.com/b/alejacma/archive/2008/07/29/how-to-use-dheapmon-exe-to-troubleshoot-desktop-heap-issues.aspx

And lastly, how to tweak that registry key to make things work:

http://blogs.msdn.com/b/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx

share|improve this answer
add comment

Have you run a memory test? memtest is one such utility.

It could be that you're getting errors which aren't showing up when you look for free space. The application could report them better, but they might not be distinguishable to the code.

It would ask for X bytes and if it didn't get the required amount it would assume there wasn't enough rather then there being a problem with the memory.

share|improve this answer
    
Haven't tried memtest. Allocations of memory work fine: I can allocate (and then utilize) several hundred megabytes of memory. –  Thanatos Jul 1 '10 at 19:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.