diff --git a/runtime/vm/globals.h b/runtime/vm/globals.h index 682ee906552..aa436e1732f 100644 --- a/runtime/vm/globals.h +++ b/runtime/vm/globals.h @@ -36,7 +36,11 @@ const intptr_t kSmiMin32 = -(static_cast(1) << kSmiBits32); const intptr_t kBytesPerBigIntDigit = 4; // The default old gen heap size in MB, where 0 == unlimited. -const intptr_t kDefaultMaxOldGenHeapSize = (kWordSize <= 4) ? 1536 : 0; +// 32-bit: OS limit is 2 or 3 GB +// 64-bit: OS limit is 2^16 page table entries * 256 KB HeapPages = 16 GB +// Set the VM limit below the OS limit to increase the likelihood of failing +// gracefully with a Dart OutOfMemory exception instead of SIGABORT. +const intptr_t kDefaultMaxOldGenHeapSize = (kWordSize <= 4) ? 1536 : 15360; #define kPosInfinity bit_cast(DART_UINT64_C(0x7ff0000000000000)) #define kNegInfinity bit_cast(DART_UINT64_C(0xfff0000000000000))