changeset 40931:d4d2a4a0e023

8161079: Default heap size causes native memory exhaustion on 32 bit Windows Reviewed-by: tschatzl, sjohanss
author mgerdin
date Fri, 02 Sep 2016 16:45:16 +0200
parents 3ef70f1039da
children cdc9d0ff3fa2 e8c366069761 496463b4e206
files hotspot/src/os/windows/vm/os_windows.cpp
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Wed Sep 07 23:17:24 2016 +0200
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Fri Sep 02 16:45:16 2016 +0200
@@ -3796,6 +3796,11 @@
   GlobalMemoryStatusEx(&ms);
   _physical_memory = ms.ullTotalPhys;
 
+  if (FLAG_IS_DEFAULT(MaxRAM)) {
+    // Adjust MaxRAM according to the maximum virtual address space available.
+    FLAG_SET_DEFAULT(MaxRAM, MIN2(MaxRAM, (uint64_t) ms.ullTotalVirtual));
+  }
+
   OSVERSIONINFOEX oi;
   oi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
   GetVersionEx((OSVERSIONINFO*)&oi);