本文介绍了如何打开GCStress在Windows 7?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我调试一个 GC 堆损坏,并来到了一步,我想尝试下的WinDbg +页堆+ 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.

我发现在文章的的,我可以启用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

哪条路是正确的或者是有其他的正确的办法吗?

推荐答案

我的。原来,了解它是最好的方式通过查看 .NET源$ C $Ç

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

这篇关于如何打开GCStress在Windows 7?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 01:26