summaryrefslogtreecommitdiff
path: root/src/vm/gcenv.ee.cpp
diff options
context:
space:
mode:
authorMaoni Stephens <Maoni0@users.noreply.github.com>2018-12-26 13:13:21 -0800
committerGitHub <noreply@github.com>2018-12-26 13:13:21 -0800
commitaa13ca95d633e9251fa040533d3d5650808455c0 (patch)
tree87e76cd95fdff758227e97ffb66a48f97c4550fb /src/vm/gcenv.ee.cpp
parent56e725e892cb67a373ac3e2121b9d667b6a40c03 (diff)
downloadcoreclr-aa13ca95d633e9251fa040533d3d5650808455c0.tar.gz
coreclr-aa13ca95d633e9251fa040533d3d5650808455c0.tar.bz2
coreclr-aa13ca95d633e9251fa040533d3d5650808455c0.zip
desktop port (#21523)
+alloc lock split into SOH and LOH +provisional mode to fix too many gen2 GCs triggered in low mem situation when the heap has heavy pinning fragmentation +better free list usage +premature OOM fixes +3 new configs: GCHeapAffinitizeMask, GCHighMemPercent, GCLOHThreshold (will be documented) YieldProcessor scaling factor is different on core due to the different implementation on core.
Diffstat (limited to 'src/vm/gcenv.ee.cpp')
-rw-r--r--src/vm/gcenv.ee.cpp55
1 files changed, 52 insertions, 3 deletions
diff --git a/src/vm/gcenv.ee.cpp b/src/vm/gcenv.ee.cpp
index 98985422b0..6ecd325a08 100644
--- a/src/vm/gcenv.ee.cpp
+++ b/src/vm/gcenv.ee.cpp
@@ -48,7 +48,6 @@ VOID GCToEEInterface::SyncBlockCacheWeakPtrScan(HANDLESCANPROC scanProc, uintptr
SyncBlockCache::GetSyncBlockCache()->GCWeakPtrScan(scanProc, lp1, lp2);
}
-
//EE can perform post stack scanning action, while the
// user threads are still suspended
VOID GCToEEInterface::AfterGcScanRoots (int condemned, int max_gen,
@@ -1084,6 +1083,24 @@ bool GCToEEInterface::GetIntConfigValue(const char* key, int64_t* value)
GC_NOTRIGGER;
} CONTRACTL_END;
+ if (strcmp(key, "GCSegmentSize") == 0)
+ {
+ *value = g_pConfig->GetSegmentSize();
+ return true;
+ }
+
+ if (strcmp(key, "GCgen0size") == 0)
+ {
+ *value = g_pConfig->GetGCgen0size();
+ return true;
+ }
+
+ if (strcmp(key, "GCLOHThreshold") == 0)
+ {
+ *value = g_pConfig->GetGCLOHThreshold();
+ return true;
+ }
+
WCHAR configKey[MaxConfigKeyLength];
if (MultiByteToWideChar(CP_ACP, 0, key, -1 /* key is null-terminated */, configKey, MaxConfigKeyLength) == 0)
{
@@ -1091,10 +1108,33 @@ bool GCToEEInterface::GetIntConfigValue(const char* key, int64_t* value)
return false;
}
+ // There is no ConfigULONGLONGInfo, and the GC uses 64 bit values for things like GCHeapAffinitizeMask,
+ // so have to fake it with getting the string and converting to uint64_t
if (CLRConfig::IsConfigOptionSpecified(configKey))
{
- CLRConfig::ConfigDWORDInfo info { configKey , 0, CLRConfig::EEConfig_default };
- *value = CLRConfig::GetConfigValue(info);
+ CLRConfig::ConfigStringInfo info { configKey, CLRConfig::EEConfig_default };
+ LPWSTR out = CLRConfig::GetConfigValue(info);
+ if (!out)
+ {
+ // config not found
+ CLRConfig::FreeConfigString(out);
+ return false;
+ }
+
+ wchar_t *end;
+ uint64_t result;
+ errno = 0;
+ result = _wcstoui64(out, &end, 16);
+ // errno is ERANGE if the number is out of range, and end is set to pvalue if
+ // no valid conversion exists.
+ if (errno == ERANGE || end == out)
+ {
+ CLRConfig::FreeConfigString(out);
+ return false;
+ }
+
+ *value = static_cast<int64_t>(result);
+ CLRConfig::FreeConfigString(out);
return true;
}
@@ -1502,3 +1542,12 @@ void GCToEEInterface::AnalyzeSurvivorsFinished(int condemnedGeneration)
}
}
}
+
+void GCToEEInterface::VerifySyncTableEntry()
+{
+ LIMITED_METHOD_CONTRACT;
+
+#ifdef VERIFY_HEAP
+ SyncBlockCache::GetSyncBlockCache()->VerifySyncTableEntry();
+#endif // VERIFY_HEAP
+}