【发布时间】:2015-03-13 22:32:44
【问题描述】:
我有一个 IIS 进程的转储,它消耗了几乎 100% 的 CPU。我运行windbg,在运行!runaway 命令后,我发现最上面的线程都卡在了Dictionary FindEntry(System.__Canon) 命令中。这些线程之一的堆栈以:
0:043> !clrstack -p
OS Thread Id: 0x1740 (43)
Child SP IP Call Site
0000008646eecc78 00007ff810530c8a [RedirectedThreadFrame: 0000008646eecc78]
0000008646eecd10 00007ffffe420ccd System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]].FindEntry(System.__Canon)
PARAMETERS:
this = <no data>
key = <no data>
0000008646eecd80 00007ffffe422ed4 System.Collections.Generic.Dictionary`2[[System.__Canon, mscorlib],[System.__Canon, mscorlib]].TryGetValue(System.__Canon, System.__Canon ByRef)
PARAMETERS:
this = <no data>
key = <no data>
value = <no data>
我怀疑我的问题类似于this one,但我需要更多证据才能得出结论。为此,我希望我可以获得有关字典的值或任何其他信息。看这段代码,与网络上的大多数教程有两点不同:
- 参数显示为
System.__Canon。这是什么意思? - 如何从
TryGetValue中获取值,因为它只有对输出的引用 (ByRef),并且指针未列在“参数”部分。
提前致谢!
【问题讨论】:
-
您在寻找如何使用 TryGetValue 的示例
-
来自blogs.msdn.com/b/dotnet/archive/2012/10/09/… 的PerfView 可能比windbg 更适合这个。
标签: c# dictionary windbg