How to keep Windows XP stable

Using the task manager to make Windows XP perform better

Wednesday, October 22, 2003 by Draginol | Discussion: Personal Computing

My work machine stays up for weeks and often months at a time. In fact, the only time it gets rebooted is when our office loses power (which is too frequently, yea I should get a UPS).

People are often shocked at this. How do I keep my system running for so long, especially given how hard I push it day in and day out while running all the major components of Object Desktop? On Windows XP, it's actually pretty easy -- once you know what affects stability.

It all starts with the task manager.  To get to that, hit CTRL-SHIFT-ESC. When you do that, the task manager in Windows XP will come up.

Whenever you have a problem with your system, whether it be acting slow or saying it's out of memory or just acting weird, you'll want to pull up the task manager.

Once you do that, go to the Performance tab.  Check and see how much RAM is in use.  A lot of young techies get obsessed with the amount of memory committed. Don't.  Check to see if your CPU meter is pegged too high, check to make sure you're not using a ridiculous amount of memory (I have 1 gig installed so 419MB in use is no biggie).  But most importantly: Check the handles in use.  This is what slows down your system.

The # of handles in use should never grow much beyond 12,000.  When you get to 15,000 handles, weird things can start to happen and you'll feel your system slow down. This is where most people just reboot. They'll throw up their hands and say "Well, time to reboot." But that's unnecessary because the task manager can tell you what program(s) are using up those handles.

So now click on the processes.  You'll want to go to View->Select Columns and choose the items that are chosen here.  You want to know things like the handle count, the GDI objects, and the User Objects.  If any of those numbers are >2,000 on a given item, that item is doing something bad.

Once you have that set up. Look at the column headers. Sort by the ones I've highlighted in yellow first. Is something using up most of your CPU? Then kill it if it's not supposed to. Is something using more than 2000 handles? If so, you should probably kill that too. Same for User Objects and GDI Objects.

And then finally, sort by memory usage and then VM size. Don't worry too much about those numbers unless you're running low on RAM. The VM Size column isn't terribly useful anyway because it double counts libraries being loaded (i.e. a program that needs to read .PNG files will load a library that uses that but another one that uses the same library will get that counted too. Mem Usage is the one to keep an eye on.  But again, even there, don't sweat that number too much unless it's using a signficant percentage of your installed memory.  Internet Explorer is using 21 megs of RAM. Sounds like a lot right? But that's only 2% of my installed memory.  Back in the old DOS days of 640K 2% would be just over 12K of memory.

CPU, Handles, GDI Objects, User Objects, these are the things to keep an eye on. If you kill processes that are using up an unusual amount of these resources, you can keep your system up indefinitely.

 

First Previous Page 3 of 3 Next Last
MConeUSA
Reply #41 Thursday, March 15, 2007 5:37 PM
This was a very important find for me, and wanted to thank you for the excellent tip of watching handles. I am involved with developing scores of integrated systems for a specialized application. Several of my customer's systems will run only 3 to 5 days before requiring rebooting. I had attributed the problem to my software, because my software is always the major package running on the system when the system starts producing severe errors. However, after reading your article, there appears to be another culprit.

Discovery: A single program sold with the Netgear USB wireless adaptor that we use on many of our systems (RtlWake.exe) continually racks up handles until the system runs out of resources. The problem is less pronounced on Windows 2000. On one Win2000 system that had been running for a week, the handle count for this software was at about 300,000 and climbing.

SYMPTOMS in WINDOWS 2000:The errors reported on Windows 2000 is: ERROR_RESOURCE_TYPE_NOT_FOUND (Error 1813). When this error occurs, then Windows is completely unable to print the Start menu, and will not allow a regular shutdown (it believes that you don't have enough permission to shutdown).

SYMPTOMS in WINDOWS XP: The handle count issue is MUCH worse in XP (compared to Win2000) as the count grows much faster. No error messages are reported in our Windows XP systems. The key event is that Windows has trouble repainting controls on the screen. Then the whole system freezes quickly after the paint problems.

For several weeks, we have been watching Available Memory only. Memory was dropping consistently at about 4 megabytes an hour in XP systems. I suspected that a serious memory leak existed in my software. However, according Task Manager Processes menu, our software does not leak memory. Also, the symptoms described above occurred when there was still 25 GB of memory remaining in one test system. So examining the Handle Count was a real break-through. I now conclude that Available Memory dropped only as one symptom of the huge accumulating Handle Count.

Thank you very much for this helpful article. You've saved me and my colleagues a great deal of trouble!


sacol95
Reply #42 Monday, January 26, 2009 10:13 PM
Thanks for the info!
Daiwa
Reply #43 Monday, January 26, 2009 10:34 PM

Thank you sacol95 for making this hit the 'recent activity' list or I might never have seen it.

My XP desktop seldom gives me enough trouble to require a reboot, but it happens with a degree of regularity.  I just took a peek at TM & lo & behold: Symantec's wfxctrl32.exe (WinFax Pro) was sitting at 1.6 million (that's right, million) handles & climbing at a steady 2 handle per second clip.  I leave this running in my SysTray as my 'always on' incoming fax receiver.  Maybe not anymore.  After reading Brad's original post, it's a miracle the rig hasn't choked to death already.  Too bad, WinFax Pro is a pretty good app otherwise, though I have enough history with Symantec products that I'm not at all surprised.

DjiRate
Reply #44 Monday, January 26, 2009 11:04 PM

excellent...i wonder if this is pretty much the same on vista...there are a few different column names in vista task manager  but i wonder if its basically the same idea?....excellent post

DarthCaedusMorgan
Reply #45 Tuesday, January 27, 2009 12:39 AM

jojo25
excellent...i wonder if this is pretty much the same on vista...there are a few different column names in vista task manager  but i wonder if its basically the same idea?....excellent post

I think it should be somewhat the same in vista however i think there are more handles in vista, I run my vista 32 24/7, with on average 18k to 21k handles, mainly I run folding@home program which takes up 50% cpu but i can still run games on lower graphic levels quite fine, not sure how tell which process tke up how many handles.

Audiafox
Reply #46 Friday, February 6, 2009 12:38 PM

Huh, I never knew Ctrl+Shift+Esc opened the Task Manager.  I've always used Ctrl+Alt+Delete.

CobraA1
Reply #47 Friday, February 6, 2009 1:07 PM

Interesting - Outlook seems to open 2000+ handles on the spot. My system has ~43000 handles open currently. 64 bit Vista, though.

Another thing to look at is threads - the more threads, the more task switching, and sometimes just switching between too many tasks can eat up CPU time. Context switching is expensive. Sometimes developers seem to miss the idea that the optimal number of threads is the number of cores your computer has. You'd be surprised how many threads some applications have open at one time!

I'm not sure really how handles affect performance, though - a handle not being used may use some memory, but I'm don't understand why it would affect much else. I wonder if there's a good place to look up how these different types of resources affect memory, CPU, and stability?

Crazie_Guy
Reply #48 Friday, February 6, 2009 1:10 PM

o m g that is the exact theme i use for my browser op.

Is that a normal xp theme that i could download somewhere or did you put it in with that objectdesktop thing? I must have it....

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01