summaryrefslogtreecommitdiff
path: root/src/vm/profilinghelper.cpp
diff options
context:
space:
mode:
authorDavid Mason <davmason@microsoft.com>2018-02-14 02:18:39 -0800
committerGitHub <noreply@github.com>2018-02-14 02:18:39 -0800
commit4d1abfbb93e614fcc88cbd848b4c718b702841ab (patch)
tree3ca6700645e46bdcca7e632c87c4cad7bea43007 /src/vm/profilinghelper.cpp
parent3a7b5f6cbb7a024c2cdf0ab9546ca7d2e593760b (diff)
downloadcoreclr-4d1abfbb93e614fcc88cbd848b4c718b702841ab.tar.gz
coreclr-4d1abfbb93e614fcc88cbd848b4c718b702841ab.tar.bz2
coreclr-4d1abfbb93e614fcc88cbd848b4c718b702841ab.zip
Fix for issue #13153 - change SetGCConcurrent to TemporaryDisableConcurrentGC for profiler startup path. (#16314)
Diffstat (limited to 'src/vm/profilinghelper.cpp')
-rw-r--r--src/vm/profilinghelper.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/vm/profilinghelper.cpp b/src/vm/profilinghelper.cpp
index b1fb228acb..d711100cd7 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"));
}
}