comparison src/os/linux/vm/os_linux.cpp @ 3913: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 9447b2fb6fcf
children 3607aac85aa9 f08d439fab8c
comparison
equal deleted inserted replaced
3890:4668545121b8 3913:27702f012017
2529 if (UseNUMAInterleaving) { 2529 if (UseNUMAInterleaving) {
2530 numa_make_global(addr, size); 2530 numa_make_global(addr, size);
2531 } 2531 }
2532 return true; 2532 return true;
2533 } 2533 }
2534 return false; 2534 // Fall through and try to use small pages
2535 } 2535 }
2536 2536
2537 return commit_memory(addr, size, exec); 2537 if (commit_memory(addr, size, exec)) {
2538 realign_memory(addr, size, alignment_hint);
2539 return true;
2540 }
2541 return false;
2538 } 2542 }
2539 2543
2540 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) { 2544 void os::realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
2541 if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) { 2545 if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
2542 // We don't check the return value: madvise(MADV_HUGEPAGE) may not 2546 // We don't check the return value: madvise(MADV_HUGEPAGE) may not