Default gcAllowVeryLargeObjects to true (dotnet/coreclr#8853)
authormikedn <onemihaid@hotmail.com>
Tue, 10 Jan 2017 05:00:39 +0000 (07:00 +0200)
committerJan Kotas <jkotas@microsoft.com>
Tue, 10 Jan 2017 05:00:39 +0000 (21:00 -0800)
* Default gcAllowVeryLargeObjects to true

* Update tests for gcAllowVeryLargeObjects

These 2 tests appear to rely on gcAllowVeryLargeObjects being false in that they expect an exception to be thrown when allocating a very large array.

Increase the number of array elements so that an OutOfMemoryException is always thown no matter what value gcAllowVeryLargeObjects has. 81*98*58*36*74*4 is 4906065024 which is larger than 2^32, the theoretical array length limit.

Commit migrated from https://github.com/dotnet/coreclr/commit/163983ecf59c70d7c286e740f7cd3230f12a0f3c

src/coreclr/src/inc/clrconfigvalues.h
src/coreclr/tests/src/JIT/Regression/VS-ia64-JIT/V2.0-RTM/b539509/b539509.cs
src/coreclr/tests/src/JIT/jit64/regress/vsw/539509/test1.cs

index a0183d2..cf71e46 100644 (file)
@@ -338,7 +338,7 @@ RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_GCprnLvl, W("GCprnLvl"), "Spe
 RETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCRetainVM, W("GCRetainVM"), 0, "When set we put the segments that should be deleted on a standby list (instead of releasing them back to the OS) which will be considered to satisfy new segment requests (note that the same thing can be specified via API which is the supported way)")
 RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_GCSegmentSize, W("GCSegmentSize"), "Specifies the managed heap segment size")
 RETAIL_CONFIG_DWORD_INFO_DIRECT_ACCESS(UNSUPPORTED_GCLOHCompact, W("GCLOHCompact"), "Specifies the LOH compaction mode")
-RETAIL_CONFIG_DWORD_INFO(EXTERNAL_gcAllowVeryLargeObjects, W("gcAllowVeryLargeObjects"), 0, "allow allocation of 2GB+ objects on GC heap")
+RETAIL_CONFIG_DWORD_INFO(EXTERNAL_gcAllowVeryLargeObjects, W("gcAllowVeryLargeObjects"), 1, "allow allocation of 2GB+ objects on GC heap")
 RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_GCStress, W("GCStress"), 0, "trigger GCs at regular intervals", CLRConfig::REGUTIL_default)
 CONFIG_DWORD_INFO_EX(INTERNAL_GcStressOnDirectCalls, W("GcStressOnDirectCalls"), 0, "whether to trigger a GC on direct calls", CLRConfig::REGUTIL_default)
 RETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCStressStart, W("GCStressStart"), 0, "start GCStress after N stress GCs have been attempted")
index 0b1dfce..abeaa01 100644 (file)
@@ -133,7 +133,7 @@ public class AA<TA, TB, TC, TD, TE, TF>
         do
         {
             bool[, , , ,][,] local8 = (new bool[81u, 98u, ((uint)(58.0f)), ((uint)(36.0f)),
-                74u][,]);
+                74u*4u][,]);
             while ((((uint)(local5)) != 4u))
             {
                 if (Convert.ToBoolean((local5 + local5)))
index 83a29aa..1a4b952 100644 (file)
@@ -162,7 +162,7 @@ public class AA<TA, TB, TC, TD, TE, TF>
         do
         {
             bool[,,,,][,] local8 = (new bool[81u, 98u, ((uint)(58.0f)), ((uint)(36.0f)),
-                74u][,]);
+                74u*4u][,]);
             while ((((uint)(local5)) != 4u))
             {
                 if (Convert.ToBoolean((local5 + local5)))