diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp index a327fd91592f3893700fc6f4a07e1c93ba35142a..6d793d895fbc2ac61ccca117a5833ed020aca0ee 100644 --- a/src/os/linux/vm/os_linux.cpp +++ b/src/os/linux/vm/os_linux.cpp @@ -116,6 +116,20 @@ julong os::physical_memory() { 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 --git a/src/os/windows/vm/os_windows.cpp b/src/os/windows/vm/os_windows.cpp index 7f2293385903ecad3598223cb49b381e524d54e5..54e802a9d851755f20a04c09296e1b233cde4570 100644 --- a/src/os/windows/vm/os_windows.cpp +++ b/src/os/windows/vm/os_windows.cpp @@ -621,7 +621,12 @@ julong os::physical_memory() { } 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 --git a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp index 972ee017c4048b4fbf819e9fc349d3b4bd14e72d..57631b5cde54b368f3f63682396ba5a3fa5c716e 100644 --- a/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +++ b/src/os_cpu/linux_x86/vm/os_linux_x86.cpp @@ -157,23 +157,8 @@ frame os::current_frame() { } } - // 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