comparison src/os/windows/vm/os_windows.cpp @ 8854:754c24457b20

7112912: Message "Error occurred during initialization of VM" on boxes with lots of RAM Summary: Ergonomics now also takes available virtual memory into account when deciding for a heap size. The helper method to determine the maximum allocatable memory block now uses the appropriate OS specific calls to retrieve available virtual memory for the java process. In 32 bit environments this method now also searches for the maximum actually reservable amount of memory. Merge previously separate implementations for Linux/BSD/Solaris into a single method. Reviewed-by: jmasa, tamao
author tschatzl
date Wed, 27 Mar 2013 19:21:18 +0100
parents 6b803ba47588
children 0ca3dd0ffaba
comparison
equal deleted inserted replaced
8853:2e093b564241 8854:754c24457b20
684 684
685 julong os::physical_memory() { 685 julong os::physical_memory() {
686 return win32::physical_memory(); 686 return win32::physical_memory();
687 } 687 }
688 688
689 julong os::allocatable_physical_memory(julong size) { 689 bool os::has_allocatable_memory_limit(julong* limit) {
690 MEMORYSTATUSEX ms;
691 ms.dwLength = sizeof(ms);
692 GlobalMemoryStatusEx(&ms);
690 #ifdef _LP64 693 #ifdef _LP64
691 return size; 694 *limit = (julong)ms.ullAvailVirtual;
695 return true;
692 #else 696 #else
693 // Limit to 1400m because of the 2gb address space wall 697 // Limit to 1400m because of the 2gb address space wall
694 return MIN2(size, (julong)1400*M); 698 *limit = MIN2((julong)1400*M, (julong)ms.ullAvailVirtual);
699 return true;
695 #endif 700 #endif
696 } 701 }
697 702
698 // VC6 lacks DWORD_PTR 703 // VC6 lacks DWORD_PTR
699 #if _MSC_VER < 1300 704 #if _MSC_VER < 1300