我的照片
姓名:

I worked in Aspen Iechnology Inc. My work focus on InfoPlus.21

2009年6月17日星期三

Summary -- How to debug with SOS.dll in Visual Studio ?

This is a summary from the article http://beta.blogs.msdn.com/tess/archive/2007/10/19/net-finalizer-memory-leak-debugging-with-sos-dll-in-visual-studio.aspx

 

From this article, I learned how to use SOS in Visual Studio. SOS can be a great help for debugging managed application.

1,  Enable native debugging for the project

1.png

2, Use “break all” menu ( under Debug\Break all ) to break

 

3, Load SOS.dll by using “.load” command in immediate window

2.png

 

4, Use “!help” command in immediate window, you can find how many useful command are available in SOS

 

5, Some general commands in SOS, You can use “ !help XXX” to find out what the XXX command is used for.

!clrstack                                        

!dumpheap – stat                     

!eeheap   -gc  

!dumpstack

!threads

!dumpobj

!gcroot

!syncblk

!objsize

!pe

!finalizequeue

 

 

Very easy and very powerful!

 


This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email, and any attachments thereto, is strictly prohibited. If you receive this email in error please immediately notify the sender and permanently delete the original copy and any copy of any e-mail, and any printout thereof.

0 条评论:

发表评论

订阅 博文评论 [Atom]

<< 主页