且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我如何在.NET中的线程转储? (一拉JVM线程转储)

更新时间:2022-05-14 23:11:45

如果你想获得一个堆栈转储,而进程已经运行(一拉jstack),那里描述的here

If you're trying to get a stack dump while the process is already running (a la jstack), there are two methods as described here:

有一个鲜为人知但有效的工具,称为Managed堆栈管理器的。虽然有基本的图形用户界面,它可以有效地将一个.NET相当于jstack,如果你要添加的路径;那么它的打字只是一个问题:

There is a little-known but effective tool called the Managed Stack Explorer. Although it features a basic GUI, it can effectively be a .NET equivalent of jstack if you add to the path; then it’s just a question of typing:

mse /s /p <pid>

  1. 下载并安装相应的调试工具的Windows版本的体系结构(x86 / 64 /安腾)
  2. 如果您需要有关Windows函数调用的信息(例如,你想跟踪到内核调用),下载并安装相应的符号。这不是严格必要的,如果你只是想你自己的code线程转储。
  3. 如果您需要行号或其他详细信息,请务必将您的程序集PDB文件所在的调试器可以找到它们(通常你只要把他们旁边,你的实际程序集)。
  4. 在开始 - >程序 - > Windows调试工具[64] - > WinDbg的
  5. 使用菜单将调试器附加到正在运行的进程
  6. 加载SOS扩展名.loadby索斯mscorwks为.NET 2.0(.load SOS对.NET 1.0 / 1.1)
  7. 使用以一个线程转储!eestack
  8. 在分离使用.detach

我只是发现有必要采取生产线程转储,这为我工作。希望它可以帮助: - )

I just found it necessary to take a production thread dump and this worked for me. Hope it helps :-)