Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/gc_implementation/parNew/asParNewGeneration.hpp
38920 views
/*1* Copyright (c) 2005, 2010, Oracle and/or its affiliates. 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#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP25#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP2627#include "gc_implementation/parNew/parNewGeneration.hpp"28#include "gc_implementation/shared/adaptiveSizePolicy.hpp"2930// A Generation that does parallel young-gen collection extended31// for adaptive size policy.3233// Division of generation into spaces34// done by DefNewGeneration::compute_space_boundaries()35// +---------------+36// | uncommitted |37// |---------------|38// | ss0 |39// |---------------|40// | ss1 |41// |---------------|42// | |43// | eden |44// | |45// +---------------+ <-- low end of VirtualSpace46//47class ASParNewGeneration: public ParNewGeneration {4849size_t _min_gen_size;5051// Resize the generation based on the desired sizes of52// the constituent spaces.53bool resize_generation(size_t eden_size, size_t survivor_size);54// Resize the spaces based on their desired sizes but55// respecting the maximum size of the generation.56void resize_spaces(size_t eden_size, size_t survivor_size);57// Return the byte size remaining to the minimum generation size.58size_t available_to_min_gen();59// Return the byte size remaining to the live data in the generation.60size_t available_to_live() const;61// Return the byte size that the generation is allowed to shrink.62size_t limit_gen_shrink(size_t bytes);63// Reset the size of the spaces after a shrink of the generation.64void reset_survivors_after_shrink();6566// Accessor67VirtualSpace* virtual_space() { return &_virtual_space; }6869virtual void adjust_desired_tenuring_threshold();7071public:7273ASParNewGeneration(ReservedSpace rs,74size_t initial_byte_size,75size_t min_byte_size,76int level);7778virtual const char* short_name() const { return "ASParNew"; }79virtual const char* name() const;80virtual Generation::Name kind() { return ASParNew; }8182// Change the sizes of eden and the survivor spaces in83// the generation. The parameters are desired sizes84// and are not guaranteed to be met. For example, if85// the total is larger than the generation.86void resize(size_t eden_size, size_t survivor_size);8788virtual void compute_new_size();8990size_t max_gen_size() { return _reserved.byte_size(); }91size_t min_gen_size() const { return _min_gen_size; }9293// Space boundary invariant checker94void space_invariants() PRODUCT_RETURN;95};9697#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP9899100