Click here to Skip to main content
15,887,434 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
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 at http://social.msdn.microsoft.com/Forums/en/clr/thread/0fcb5bb1-0cd8-40e4-96d9-f0cb8b6cdbdf[^] that I can enable GCStress like this:

<small>reg.exe add "HKLM\SOFTWARE\Microsoft\.NETFramework" /f  /v HeapVerify  /t REG_DWORD  /d 1  <br />
reg.exe add "HKLM\SOFTWARE\Microsoft\.NETFramework" /f  /v StressLog  /t REG_DWORD  /d 1  <br />
reg.exe add "HKLM\SOFTWARE\Microsoft\.NETFramework" /f  /v GCStress  /t REG_DWORD  /d 3  <br />
reg.exe add "HKLM\SOFTWARE\Microsoft\.NETFramework" /f  /v FastGcStress  /t REG_DWORD  /d 2</small>


[ trying this method - 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 at http://social.msdn.microsoft.com/Forums/en/clr/thread/33920b39-690c-42c8-b04a-0f1f7176835a[^] described the other method:
<br />
    <small>(DWORD) StressLog = 1  <br />
    (DWORD) LogFacility = 0xffffffff  <br />
    (DWORD) StressLogSize = 65536</small>


Which way is correct or is there another correct way?
Posted

1 solution

I read that itz a known issue which will be fixed in the next version of the .NET Framework.

Itz recommeded to disable background GC setting in the application configuration file, as the work around.
XML
<configuration>

    <runtime>

        <gcConcurrent enabled="false"/>

    </runtime>

</configuration>
 
Share this answer
 
v2
Comments
net_prog 7-Nov-11 7:18am    
Yes, that worked for me. But the question still remains - how to enable GCStress.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900