Path: blob/master/src/hotspot/share/gc/epsilon/epsilonArguments.cpp
41152 views
/*1* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#include "precompiled.hpp"25#include "gc/epsilon/epsilonArguments.hpp"26#include "gc/epsilon/epsilonHeap.hpp"27#include "gc/shared/gcArguments.hpp"28#include "gc/shared/tlab_globals.hpp"29#include "runtime/globals.hpp"30#include "runtime/globals_extension.hpp"3132size_t EpsilonArguments::conservative_max_heap_alignment() {33return UseLargePages ? os::large_page_size() : os::vm_page_size();34}3536void EpsilonArguments::initialize() {37GCArguments::initialize();3839assert(UseEpsilonGC, "Sanity");4041// Forcefully exit when OOME is detected. Nothing we can do at that point.42if (FLAG_IS_DEFAULT(ExitOnOutOfMemoryError)) {43FLAG_SET_DEFAULT(ExitOnOutOfMemoryError, true);44}4546if (EpsilonMaxTLABSize < MinTLABSize) {47log_warning(gc)("EpsilonMaxTLABSize < MinTLABSize, adjusting it to " SIZE_FORMAT, MinTLABSize);48EpsilonMaxTLABSize = MinTLABSize;49}5051if (!EpsilonElasticTLAB && EpsilonElasticTLABDecay) {52log_warning(gc)("Disabling EpsilonElasticTLABDecay because EpsilonElasticTLAB is disabled");53FLAG_SET_DEFAULT(EpsilonElasticTLABDecay, false);54}5556#ifdef COMPILER257// Enable loop strip mining: there are still non-GC safepoints, no need to make it worse58if (FLAG_IS_DEFAULT(UseCountedLoopSafepoints)) {59FLAG_SET_DEFAULT(UseCountedLoopSafepoints, true);60if (FLAG_IS_DEFAULT(LoopStripMiningIter)) {61FLAG_SET_DEFAULT(LoopStripMiningIter, 1000);62}63}64#endif65}6667void EpsilonArguments::initialize_alignments() {68size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();69size_t align = MAX2((size_t)os::vm_allocation_granularity(), page_size);70SpaceAlignment = align;71HeapAlignment = align;72}7374CollectedHeap* EpsilonArguments::create_heap() {75return new EpsilonHeap();76}777879