作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在调试 GC堆损坏并来到我想尝试在 WinDbg + PageHeap + AppVerifier + GCStress 下运行程序的步骤。
我在文章中找到 Software crash: faulting module mscorwks.dll, version 1.1.4322.2379 我可以像这样启用 GCStress:
reg.exe add "HKLM\SOFTWARE\Microsoft\.NETFramework" /f /v HeapVerify /t REG_DWORD /d 1
reg.exe add "HKLM\SOFTWARE\Microsoft\.NETFramework" /f /v StressLog /t REG_DWORD /d 1
reg.exe add "HKLM\SOFTWARE\Microsoft\.NETFramework" /f /v GCStress /t REG_DWORD /d 3
reg.exe add "HKLM\SOFTWARE\Microsoft\.NETFramework" /f /v FastGcStress /t REG_DWORD /d 2
(我正在尝试这种方法。它需要永远启动程序。我从注册表中删除了最后两个条目以使其工作,可能方法本身有问题。)
或文章 Access Violation in .NET 4 Runtime in gc_heap::garbage_collect with no unmanaged modules 描述了另一种方法:
(DWORD) StressLog = 1
(DWORD) LogFacility = 0xffffffff
(DWORD) StressLogSize = 65536
哪种方式是正确的,还是有另一种正确方式?
最佳答案
我searched GCStress on Koders .事实证明,了解它的最佳方式是查看 .NET's source code。 :
enum GCStressFlags {
GCSTRESS_NONE = 0,
GCSTRESS_ALLOC = 1, // GC on all allocations and 'easy' places
GCSTRESS_TRANSITION = 2, // GC on transitions to preemtive GC
GCSTRESS_INSTR_JIT = 4, // GC on every allowable JITed instruction
GCSTRESS_INSTR_NGEN = 8, // GC on every allowable NGEN instruction
GCSTRESS_UNIQUE = 16, // GC only on a unique stack trace
};
关于.net - 如何在 Windows 7 中打开 GCStress?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7556224/
我是一名优秀的程序员,十分优秀!