# HG changeset patch # User phh # Date 1196874240 28800 # Node ID 171c404abf7258be1e771e34aa312d06c84b3b12 # Parent d66300cdf939cf6886e4d3f781161fa8ebf40804 6629887: 64-bit windows should not restrict default heap size to 1400m Reviewed-by: jmasa, sbohne, ikrylov, xlu diff -r d66300cdf939 -r 171c404abf72 hotspot/src/os/linux/vm/os_linux.cpp --- a/hotspot/src/os/linux/vm/os_linux.cpp Wed Dec 05 09:03:00 2007 -0800 +++ b/hotspot/src/os/linux/vm/os_linux.cpp Wed Dec 05 09:04:00 2007 -0800 @@ -116,6 +116,20 @@ return Linux::physical_memory(); } +julong os::allocatable_physical_memory(julong size) { +#ifdef _LP64 + return size; +#else + julong result = MIN2(size, (julong)3800*M); + if (!is_allocatable(result)) { + // See comments under solaris for alignment considerations + julong reasonable_size = (julong)2*G - 2 * os::vm_page_size(); + result = MIN2(size, reasonable_size); + } + return result; +#endif // _LP64 +} + //////////////////////////////////////////////////////////////////////////////// // environment support diff -r d66300cdf939 -r 171c404abf72 hotspot/src/os/windows/vm/os_windows.cpp --- a/hotspot/src/os/windows/vm/os_windows.cpp Wed Dec 05 09:03:00 2007 -0800 +++ b/hotspot/src/os/windows/vm/os_windows.cpp Wed Dec 05 09:04:00 2007 -0800 @@ -621,7 +621,12 @@ } julong os::allocatable_physical_memory(julong size) { +#ifdef _LP64 + return size; +#else + // Limit to 1400m because of the 2gb address space wall return MIN2(size, (julong)1400*M); +#endif } // VC6 lacks DWORD_PTR diff -r d66300cdf939 -r 171c404abf72 hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Wed Dec 05 09:03:00 2007 -0800 +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Wed Dec 05 09:04:00 2007 -0800 @@ -157,23 +157,8 @@ } } - // Utility functions -julong os::allocatable_physical_memory(julong size) { -#ifdef AMD64 - return size; -#else - julong result = MIN2(size, (julong)3800*M); - if (!is_allocatable(result)) { - // See comments under solaris for alignment considerations - julong reasonable_size = (julong)2*G - 2 * os::vm_page_size(); - result = MIN2(size, reasonable_size); - } - return result; -#endif // AMD64 -} - // From IA32 System Programming Guide enum { trap_page_fault = 0xE