Practice First

实践第一

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

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!

posted on 2009-10-08 10:22  caoshenghe  阅读(240)  评论(0编辑  收藏  举报