gpt4 book ai didi

.net - 如何在 Windows 7 中打开 GCStress?

转载 作者:可可西里 更新时间:2023-11-01 12:57:12 24 4
gpt4 key购买 nike

我正在调试 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com