This project is read-only.

What you should do to fix your program.

A lot will depend on the type of symptom you are seeing:
  • Crashes, kicking back into the debugger, blue screens of death. These are very obvious symptoms, implying something is very wrong with your application
  • Increased memory usage, or the computer has become unresponsive are signs of a resource leak, that can be fixed with some analysis and changes in implementation

The Obvious: Crashes

The most obvious one first:
  • The application crashed
  • Your application halted and is in the debugger

If these happened, you'll need to look thru whatever debug logs you have to track down the exceptions. You may wish to look thru the system event log to see what application events where logged.

Resource Leaks

Things to check with Task Manager:
  • Increased memory usage over time
  • Increased number of handles -- not by one or two, but hundreds or thousands
  • Increased number of of threads -- not by one or two, but hundreds or thousands

In these cases you have a leak. You want to use an application profiler, and see what the most common kind of objects you have. If you're leaking handles, threads, or some other system resource, you probably need to go thru and add a proper Dispose() call when you are done with them. If you have lots of objects accumulated, you may need to add a Dispose() call, or you may be accumulating them in some collection. Just look for the most common kind of object or the largest ones and address them first.

WPF based programs. If you are using WPF in your program, you will want to check on your favorite forum(s) and with a search engine for the kind of bugs you are seeing. Perhaps your delegates are leaking, and special rules need to be followed. Sometimes, the parameters to various WPF objects must be set correctly, otherwise they leak memory by caching objects incorrectly. Sometimes the video display driver has a leak.

Last edited Oct 19, 2009 at 3:08 PM by randym, version 3


No comments yet.