< prev index next >

src/share/vm/gc/parallel/mutableNUMASpace.cpp

Print this page
rev 11780 : [mq]: webrev.0
rev 11781 : [mq]: webrev.1

@@ -1,8 +1,8 @@
 
 /*
- * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -577,10 +577,18 @@
   size_t base_space_size_pages = pointer_delta(rounded_end, rounded_bottom, sizeof(char)) / page_size();
 
   // Try small pages if the chunk size is too small
   if (base_space_size_pages / lgrp_spaces()->length() == 0
       && page_size() > (size_t)os::vm_page_size()) {
+#ifdef 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 with large pages. Too small heap size");
+    }
+#endif // LINUX
     set_page_size(os::vm_page_size());
     rounded_bottom = (HeapWord*)round_to((intptr_t) bottom(), page_size());
     rounded_end = (HeapWord*)round_down((intptr_t) end(), page_size());
     base_space_size_pages = pointer_delta(rounded_end, rounded_bottom, sizeof(char)) / page_size();
   }
< prev index next >