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.

This one has been bothering me for years and so far I couldn't find an adequate solution.

The problem occurs on pretty much every XP install I've done. After opening a variety of programs or the system running existing programs for a while, Windows seemingly runs out of resources, without telling me.

There's ALWAYS free RAM. For example, it just happened to me and I had over a gig of free RAM. There are no viruses, spyware, or other nonsense - it is a Windows resource problem, but the question is which resource is it running out of, how does one pinpoint it, and how does one prevent it?

Sometimes, this happens after running specific programs - for example, today it happened when I started Photoshop CS4 and Flash CS4 at the same time. I also noticed that restarting The Bat (email client by Ritlabs) seems to get rid of this problem for a while but again, this happens on machines that don't even have The Bat installed.

So what does exactly happen? The symptoms are:

  • pressing alt-tab doesn't bring up the list anymore - it just jumps to the next window instantly, very similar to the way Alt-Esc works, however in this case, it's due to not having enough resources to bring up the alt-tab menu

  • random programs would randomly crash, citing random errors, out of memory errors, system resources, inabilities to do system calls, etc.

  • random programs would start missing random parts - for example, Firefox top menus might disappear, pull up partial selections, or not pull up anymore altogether. IE might lose a few of its toolbars. Some programs might fail to redraw or would just plain go gray where the UI used to be.

  • Windows itself never complains about running out of RAM, virtual memory, or anything at all, yet it's running out of something.

The only clue I was able to find and apply the fix today was this Desktop Heap Limitation. I haven't confirmed the fix working as not enough time passed. In the meantime, what are everyone's thoughts?

share|improve this question

migrated from serverfault.com Jan 24 '10 at 23:24

This question came from our site for system and network administrators.

6 Answers 6

Could be a handle leakage in a program you have running. I had a bug in one of my programs that exhibited these problems, bringing up new programs would have problems with missing or incomplete toolbars, file->open dialogs not showing, alt-tabbing not working properly, and strange errors, etc.

In Task Manager you can use the View->Columns menu to show columns for handle as well as user and gdi objects, which both uses handles, if you find a program with a high number there, it could be the culprit.

Unfortunately, what exactly a "high number" is depends entirely on the program.

In particular, pay attention to any program for which the handle count is steadily increasing, as this might indicate such a leak.

share|improve this answer
1  
Ah, now we're getting somewhere. A probable cause AND a way to track it. Thanks, voted up in the meantime. Will monitor the culprits. So far Firefox, Probe2 (by Asus), Winamp, and Flash CS4 have the highest number of GDI objects - over 1000 each. The Bat has 701 and I will be monitoring it closely. –  Artem Russakovskii May 19 '09 at 8:52
    
To be honest, that doesn't sound so bad. –  Lasse V. Karlsen May 19 '09 at 9:09
    
Heh, well the system is not crashing at the moment, so indeed, it doesn't. –  Artem Russakovskii May 19 '09 at 9:12
    
OK, the system is crashing right now. Here are the counts for the worst GDI objects: firefox - 2382, probe2 - 1375, winamp - 1239, flash - 1069, snagiteditor - 971, thebat - 758. Highest by handles: a really suspicious spoolsv.exe with 11,456 handles, ftprush - 5972, System - 2702, svchost.exe - 2384, csrss.exe 1238, firefox - 1170, flash - 1036, eclipse - 962. Hrm... –  Artem Russakovskii May 20 '09 at 4:36
    
Ah, looks like I need to restart for the Heap changes to go into effect, as specified here support.microsoft.com/default.aspx?scid=kb;EN-US;184802. Would be great to find out where exactly I'm maxing out though. –  Artem Russakovskii May 20 '09 at 4:41

That's because Windows has so called "desktop heap" where most of the GUI objects are living, menus, icons and what have you. And this space is pretty limited, and, what's more important, fixed in size.

See Q126962: On the desktop heap for solution and read Raymond Chen for some more information.

share|improve this answer
    
Yeah, I did mention that one at the end of my question. Thanks for more info on it. This is a decent assisting answer thus far. –  Artem Russakovskii May 19 '09 at 8:53
    
Oh, sorry, haven't noticed that last sentence :) But this is exactly the reason, you could check what process using most handles in Process Explorer, kill it, and that alone would fix the symptoms. –  vava May 19 '09 at 9:05

The term "resources" or "system resources" on Windows refers to various objects (such as window handles) inside the operating system. Windows limits the space allotted to resources, so that they cannot use all of system memory. That is why you have plenty of free memory but not enough resource space.

Mark Russinovich and David Solomon (of Winternals and Sysinternals fame) have written a book that details the guts of Windows thoroughly: Windows Internals. The fourth edition covers Windows 2000, XP, and Server 2003, and it is available by itself or as part of the Windows Server 2003 Resource Kit. The fifth edition will be released in June 2009, and it will cover Windows Vista and Server 2008. One or both of these volumes may be of help for you, but be warned: This is not just a Saturday-afternoon read!

share|improve this answer

Drivers, and other stuff far enough down to be playing in or around the kernel, can cause big problems when they're not working properly -- and it's a bottleneck that's not always visible in the obvious CPU, memory, or disk I/O paths.

share|improve this answer
    
Indeed, that may be so but computers I've had this occur on share no hardware - some are laptops, some are desktops. In general, there's a remote possibility that nasty bugs in different drivers plague all my machines but it's unlikely. The problem is most likely to lie deeper within the OS, like the last link in my post suggests. Time will tell, but this is not the solution I'm looking for. Sorry :) –  Artem Russakovskii May 19 '09 at 8:16
    
In addition, I'm looking for ways to diagnose, quantify, and zero in on the problematic resources. Any pointers there would be nice. –  Artem Russakovskii May 19 '09 at 8:21
    
Process explorer (technet.microsoft.com/en-us/sysinternals/bb896653.aspx) is the first tool I'd use -- what's consuming resources? And how much memory are we talking about here? Is there at least 1GB in each of these machines, or less? –  nedm May 19 '09 at 8:28
    
I also use Extended Task Manager (extensoft.com/?p=free_task_manager) to keep a little better tabs on what's going on than the built-in one. –  nedm May 19 '09 at 8:31
    
Oh, and lastly, verifier.exe (support.microsoft.com/kb/244617) can help diagnose and troubleshoot driver issues. –  nedm May 19 '09 at 8:36

" a really suspicious spoolsv.exe with 11,456 handles"

This is the print job spooler thing...Do you have printjobs waiting or that need blowing away?

Corrupt printer driver?

share|improve this answer

Did you install some kind of "tuning software"? Most of these fiddle around with settings they should not. And most apply settings which only improve benchmarkable performance but reduce real workload performance (eg interactivity) by turning the knobs of the memory manager.

share|improve this answer
    
No, I haven't - all Windows XP installations suffer from this issue, at least when you use them at a power user level. –  Artem Russakovskii May 2 '10 at 19:50

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.