如何在 Windows 7 中打开 GCStress?

发布于 2024-12-06 16:37:34 字数 1209 浏览 1 评论 0原文

我正在调试 GC 堆损坏,并来到我想尝试的步骤在 WinDbg + PageHeap + AppVerifier + GCStress 下运行程序。

我在文章软件中找到崩溃:我可以启用的错误模块 mscorwks.dll,版本 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

我正在尝试这种方法。它需要永远启动程序。我从注册表中删除了最后两个条目以使其工作,可能是该方法本身有问题。)

或者文章< a href="http://social.msdn.microsoft.com/Forums/en/clr/thread/33920b39-690c-42c8-b04a-0f1f7176835a" rel="noreferrer">没有非托管模块的 gc_heap::garbage_collect 中的 .NET 4 运行时访问冲突描述了另一种方法:

(DWORD) StressLog = 1  
(DWORD) LogFacility = 0xffffffff  
(DWORD) StressLogSize = 65536

哪种方法是正确的,或者还有其他正确 > 方式?

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.

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.)

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

已下线请稍等 2024-12-13 16:37:34

在 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
};

I searched GCStress on Koders. It turned out the best way to understand it is by looking at .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
};
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文