--- old/src/share/vm/gc/parallel/mutableNUMASpace.cpp 2016-08-26 10:31:57.594003880 -0700 +++ new/src/share/vm/gc/parallel/mutableNUMASpace.cpp 2016-08-26 10:31:57.494003883 -0700 @@ -1,6 +1,6 @@ /* - * 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 @@ -579,6 +579,14 @@ // 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());