windbg随笔

查看内存泄露

5.查看最耗内存的所在
.cls -------------------------------清屏
~ ----------------------------------查看当前程序的所有线程
~0s --------------------------------切换到我们需要调试的原托管线程中
!Threads ---------------------------命令可以查看进程内所有的托管线程,仅仅是托管线程
!dumpheap -stat --------------------统计堆的信息
!dumpheap -type System.String ------查看string类型在堆中的信息.为什是string,是因为在!dumpheap -stat的结果中,发现string占用最内存最多
!gcroot 02029348 -------------------查看内存很高的堆地址, 02029348 是!dumpheap结果中有对string操作的堆最大的Adress
!help gcroot -----------------------查看gcroot的帮助

猜你喜欢

转载自www.cnblogs.com/nocanstillbb/p/12586502.html