views:

139

answers:

4

Hi,

I was wondering if there is a less intrusive way to analyze a running, managed process in production environments.

Less intrusive meaning:

  • No delay of execution when attaching the debugger.
  • No delay of execution when getting basic stats like running threads.

In the Java world there is a such a tool part of the JDK. I was wondering if there're similar tools in the .NET world.

The tool should answer questions like:

  • What are the thread pool parameters? Same as "!threadpool" in Windbg.
  • What are the callstacks of my currently running threads (yep, you get it from the Java tool :) ).
  • Basic heap analysis e.g. howmany objects of type ABC.

Any ideas?

Alex

+2  A: 

If I understand you correctly, you don't want to actually debug the program, only get some basic information. In such cases, Process Explorer may be sufficient.

oefe
I would like to see a little more than Win32 process information. A "Managed Process Explorer" however might come pretty close. I'll go edit the question with more detail.
Alex
A: 

It depends on what you want to debug. WinDbg is the giant hammer of Windows debugging, suitable for debugging anything from kernel extensions on up.

If you just want to debug a program, most people just use visual studio, which will attach to a running processs.

However, @oefe may have the bull by the horns here. When most people say 'debugger' they want backtraces and breakpoints and such. In Java, you need to make prior arrangements to attach that sort of debugger. Either Windbg or visual studio (-debugexe) is more convenient than that.

bmargulies
I find that in a production environment Visual Studio can be very intrusive, while WinDbg is a lot easier to use due to its simple copy deployment and great support for offline debugging.
Brian Rasmussen
@Brian Rasmussen no argument.
bmargulies
Well, as for VS...his post is really regarding production environments.
Alex
+1  A: 

As Oefe says, you can get a lot of info including the stacks of all threads from Process Explorer. Also, the .NET runtime has a number of useful performance counters, that may give you some insight. If you have special needs, your application can publish its own counters.

Brian Rasmussen
+1  A: 

Here is production debugging in a non-intrusive manner using ETW and another one

Naveen