What features exist for analyzing post mortem in .NET (for example, after a program crashes)?

Suppose there is a C # program that is used as a Windows service. Suppose the service is pissed off and consumes the processor and memory as crazy. It needs to be restarted very soon, because it is a production system. Therefore, I have little time to collect information about the runtime. Maybe a quick look at the task manager ... at all.

After that, I have log4net log files and a Windows event log for post mortem analysis.

Suppose I figured out the cause of the problem. Someone else is fixing this, and maybe the programmer is adding some additional logging, so I can find a similar problem faster next time. However: I still rely on the quality of the log files and hope that next time the problem will somehow appear in the logs.

Are there other ways to analyze post mortem? Maybe something like stream dumps (like in java), memory dumps, or something else that might help in post mortem analysis? Maybe some built-in .NET framework tool can help?

I am very interested in the real experience of the project and how you will try to solve this service issue, which, in my opinion, is very real for most programmers.

+5
5

, WinDbg + SoS , Visual Studio. .

.NET Perfmon. , ( ) . . , , WinDbg SoS - . , :

  • , !dumpheap -stat, . , - , , , - , .

  • !gcroot . , .

, , : , , .

, WinDbg.

+2

.NET windbg/sos ( sosassist). , . . "+ windbg +.NET" .

- ? ? , , .

+2

WinDbg SOS Tess Ferrandez .

EDIT: ​​

+1

, - , , cordbg, sdk ( .net). http://msdn.microsoft.com/en-us/library/a6zb7c8d.aspx .

cordbg (a < [pid] > ), (t < [tid] > ), (w).

vb script, , . , .

, , , .

+1

If the process is still alive, you can run the Managed Stack Explorer to get a quick snapshot of what it is doing. You can run this without explicit installation.

In addition, then a full dump + windbg + SOS gives you the most information, but getting it is not trivial.

0
source

All Articles