From: David Mason Date: Wed, 14 Feb 2018 10:18:39 +0000 (-0800) Subject: Fix for issue #13153 - change SetGCConcurrent to TemporaryDisableConcurrentGC for... X-Git-Tag: accepted/tizen/unified/20190422.045933~2972 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d1abfbb93e614fcc88cbd848b4c718b702841ab;p=platform%2Fupstream%2Fcoreclr.git Fix for issue #13153 - change SetGCConcurrent to TemporaryDisableConcurrentGC for profiler startup path. (#16314) --- diff --git a/src/vm/profilinghelper.cpp b/src/vm/profilinghelper.cpp index b1fb228..d711100 100644 --- a/src/vm/profilinghelper.cpp +++ b/src/vm/profilinghelper.cpp @@ -1193,9 +1193,15 @@ HRESULT ProfilingAPIUtility::LoadProfiler( // and kill objects without relocating and thus not doing a heap walk. if (CORProfilerTrackGC()) { - LOG((LF_CORPROF, LL_INFO10, "**PROF: Turning off concurrent GC at startup.\n")); - g_pConfig->SetGCconcurrent(0); - LOG((LF_CORPROF, LL_INFO10, "**PROF: Concurrent GC has been turned off at startup.\n")); + LOG((LF_CORPROF, LL_INFO10, "**PROF: Turning off concurrent GC at startup.\n")); + // Previously we would use SetGCConcurrent(0) to indicate to the GC that it shouldn't even + // attempt to use concurrent GC. The standalone GC feature create a cycle during startup, + // where the profiler couldn't set startup flags for the GC. To overcome this, we call + // TempraryDisableConcurrentGC and never enable it again. This has a perf cost, since the + // GC will create concurrent GC data structures, but it is acceptable in the context of + // this kind of profiling. + GCHeapUtilities::GetGCHeap()->TemporaryDisableConcurrentGC(); + LOG((LF_CORPROF, LL_INFO10, "**PROF: Concurrent GC has been turned off at startup.\n")); } }