Debug without a Debugger

6 באוקטובר 2009

תגיות: ,
5 תגובות

Developer, know thy environment!

If you develop software and don’t have TaskManager (or some other CPU indicator) minimized at your task tray – you’re missing out. If you have the feeling that “whenever something goes wrong with your app – you’ll know and then debug it” – you’re just wrong.

taskMgr 

We need all the data you need, to save time on finding the bugs and performance issues. This trivial little 16X16 icon can tell you so much about your app – it’s amazing. When does you app spike in CPU? Does it have a constant “CPU overhead”? Does your normal environment have such overhead? When your app should be in 100% cpu – does it take less? Does it take exactly 50% (only one core is at full CPU, other is almost idle)?

Those questions are answered without even having to ask them.

And that’s just that lame TaskManager. Heard about ProcessExplorer?

A lot was said about this wonderful application, and I won’t glorify it further, other than to say that it’s probably the first thing I download and run on a new machine.

Now, as a developer – you should know the ins and outs of ProcessExplorer; again – for the information you can get. I/O graph and memory usage and physical memory usage, all at the tips of your task tray. This is how I work:

procExp 

You get the CPU graph (history, actually); memory commit history; I/O history and Physical memory usage history.

Well, actually, this is how I work:

DUMeter

The transparent graph is DUMeter, an application which monitors my network. I’ve used it for so long that I can’t properly work on a machine without it floating there.

 

//—– Part two

 

Now, the real gains you get form ProcessExplorer are the ever so simple readings you get on a managed app. The CLR exposes lots of performance counters, and ProcExp just collects them all in a great, readable format.

image

Periodically – look at the amount of exceptions in you app. Maybe it’ll surprise you. Look at the amount of marshaling. Look at the Managed Heaps. Maybe something’s off. Just look.

image

Btw, running on Vista and up, you may need to run ProcExp as Admin to see the .Net tab. You can re-launch it as admin right from the File menu:

RunAsProcExp

הוסף תגובה
facebook linkedin twitter email

כתיבת תגובה

האימייל לא יוצג באתר. (*) שדות חובה מסומנים

5 תגובות

  1. Liran Chen6 באוקטובר 2009 ב 20:54

    Besides Process Explorer, the entire SysInternals suite by Mark Russinovich is an absolute must-have in every developer's tool belt

    להגיב
  2. Ariel7 באוקטובר 2009 ב 1:10

    Could not agree more.

    להגיב
  3. Adrian7 באוקטובר 2009 ב 10:16

    No need to approve this. Just fix this:
    ProcessManager –> ProcessExplorer

    להגיב
  4. Alon Elishkov28 באוקטובר 2009 ב 12:44

    Thank you for that!
    I have never heard of ProcessExplorer before and with time I will probably find many more reasons as to how this is an efficient debugging tool, but just after a couple of minutes playing with its basic features (and finding the 'Replace Task Manager' option) i think its a bare necessity.

    and thanks again…

    להגיב