如何在Windows 7中打开GCStress? [英] How to turn GCStress on in Windows 7?
问题描述
我正在调试 GC 堆腐败,并进入了我的步骤想尝试在WinDbg + PageHeap + AppVerifier + GCStress下运行程序。
I am debugging a GC heap corruption and came to the step where I want to try running the program under WinDbg + PageHeap + AppVerifier + GCStress.
我在文章中找到了 软件崩溃:故障模块mscorwks.dll,版本1.1.4322.2379 我可以这样启用GCStress:
I found in the article Software crash: faulting module mscorwks.dll, version 1.1.4322.2379 that I can enable GCStress like this:
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
(我正在尝试这种方法。它需要程序永远启动。我从注册表中删除了最后两个条目以使其正常工作,这可能是方法本身有问题。)
(I am trying this method. It takes the program forever to launch. I deleted the last two entries from the registry to have it work, probably something is wrong with the approach itself.)
或者文章访问冲突在.NET 4运行时gc_heap :: garbage_collect中没有非管理模块 描述了另一种方法:
Or the article Access Violation in .NET 4 Runtime in gc_heap::garbage_collect with no unmanaged modules described the other method:
(DWORD) StressLog = 1
(DWORD) LogFacility = 0xffffffff
(DWORD) StressLogSize = 65536
哪种方式是正确的或是另一个正确的方式
Which way is correct or is there another correct way?
推荐答案
我在Koders上搜索GCStress 。原来,通过查看 .NET的源代码:
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
};
这篇关于如何在Windows 7中打开GCStress?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!