src/os/windows/vm/os_windows.cpp

changeset 4854
754c24457b20
parent 4711
6b803ba47588
child 4880
0ca3dd0ffaba
equal deleted inserted replaced
4853:2e093b564241 4854: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

mercurial