--- old/src/share/vm/gc/parallel/mutableNUMASpace.cpp 2016-08-26 10:32:12.330003367 -0700 +++ new/src/share/vm/gc/parallel/mutableNUMASpace.cpp 2016-08-26 10:32:12.230003370 -0700 @@ -580,10 +580,11 @@ if (base_space_size_pages / lgrp_spaces()->length() == 0 && page_size() > (size_t)os::vm_page_size()) { #ifdef LINUX - // If we are using pin region, we cannot change the page size to default size - // as we could free memory which is not expected for pin region in Linux. + // Changing the page size below can lead to freeing of memory. When using large pages + // and the memory has been both reserved and committed, Linux does not support + // freeing parts of it. So we fail initialization. if (UseLargePages && !os::can_commit_large_page_memory()) { - vm_exit_during_initialization("Failed initializing NUMA. Too small heap size"); + vm_exit_during_initialization("Failed initializing NUMA with large pages. Too small heap size"); } #endif // LINUX set_page_size(os::vm_page_size()); --- old/test/gc/arguments/TestSmallInitialHeapWithLargePageAndNUMA.java 2016-08-26 10:32:12.910003346 -0700 +++ new/test/gc/arguments/TestSmallInitialHeapWithLargePageAndNUMA.java 2016-08-26 10:32:12.810003350 -0700 @@ -41,7 +41,7 @@ public class TestSmallInitialHeapWithLargePageAndNUMA { - private static final String MSG_EXIT_TOO_SMALL_HEAP = "Failed initializing NUMA. Too small initial heap size"; + private static final String MSG_EXIT_TOO_SMALL_HEAP = "Failed initializing NUMA with large pages. Too small heap size"; private static final String MSG_GC_TRIGGERED_BEFORE_INIT = "GC triggered before VM initialization completed."; public static void main(String[] args) throws Exception { @@ -49,10 +49,10 @@ WhiteBox wb = WhiteBox.getWhiteBox(); long heapAlignment = wb.getHeapAlignment(); - // NUMA with large pages is not fully compatible in Linux, so we are using pin region. - // And the pin region case, we will skip freeing memory if the page size is larger than the default page size. - // If we allocate pages less than NUMA node, NUMA will try to use default page size. - // And this will conflict for pin region. + // When using large pages, Linux does not support freeing parts of reserved and committed memory. + // And current Linux implementation uses page size as a condition to actually freeing memory. + // If we allocate pages less than NUMA node, NUMA will try to use default page size and + // this will free the memory which Linux does not support. // Assume the minimum NUMA node as 2. long initHeap = heapAlignment; long maxHeap = heapAlignment * 2;