changeset 2847:27702f012017

7087583: Hotspot fails to allocate heap with mmap(MAP_HUGETLB) Summary: Try using small pages when transparent huge pages allocation fails Reviewed-by: ysr
author iveresov
date Tue, 06 Sep 2011 21:03:51 -0700
parents 4668545121b8
children 20213c8a3c40 c2bf0120ee5d
files src/os/linux/vm/os_linux.cpp
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/linux/vm/os_linux.cpp	Fri Sep 02 21:33:57 2011 -0700
+++ b/src/os/linux/vm/os_linux.cpp	Tue Sep 06 21:03:51 2011 -0700
@@ -2531,10 +2531,14 @@
       }
       return true;
     }
-    return false;
-  }
-
-  return commit_memory(addr, size, exec);
+    // Fall through and try to use small pages
+  }
+
+  if (commit_memory(addr, size, exec)) {
+    realign_memory(addr, size, alignment_hint);
+    return true;
+  }
+  return false;
 }
 
 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {