0N/A/*
1879N/A * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
1879N/A#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP
1879N/A#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP
1879N/A
1879N/A#include "gc_implementation/parNew/parNewGeneration.hpp"
1879N/A#include "gc_implementation/shared/adaptiveSizePolicy.hpp"
1879N/A
0N/A// A Generation that does parallel young-gen collection extended
0N/A// for adaptive size policy.
0N/A
0N/A// Division of generation into spaces
0N/A// done by DefNewGeneration::compute_space_boundaries()
0N/A// +---------------+
0N/A// | uncommitted |
0N/A// |---------------|
0N/A// | ss0 |
0N/A// |---------------|
0N/A// | ss1 |
0N/A// |---------------|
0N/A// | |
0N/A// | eden |
0N/A// | |
0N/A// +---------------+ <-- low end of VirtualSpace
0N/A//
0N/Aclass ASParNewGeneration: public ParNewGeneration {
0N/A
0N/A size_t _min_gen_size;
0N/A
0N/A // Resize the generation based on the desired sizes of
0N/A // the constituent spaces.
0N/A bool resize_generation(size_t eden_size, size_t survivor_size);
0N/A // Resize the spaces based on their desired sizes but
0N/A // respecting the maximum size of the generation.
0N/A void resize_spaces(size_t eden_size, size_t survivor_size);
0N/A // Return the byte size remaining to the minimum generation size.
0N/A size_t available_to_min_gen();
0N/A // Return the byte size remaining to the live data in the generation.
0N/A size_t available_to_live() const;
0N/A // Return the byte size that the generation is allowed to shrink.
0N/A size_t limit_gen_shrink(size_t bytes);
0N/A // Reset the size of the spaces after a shrink of the generation.
0N/A void reset_survivors_after_shrink();
0N/A
0N/A // Accessor
0N/A VirtualSpace* virtual_space() { return &_virtual_space; }
0N/A
0N/A virtual void adjust_desired_tenuring_threshold();
0N/A
0N/A public:
0N/A
0N/A ASParNewGeneration(ReservedSpace rs,
0N/A size_t initial_byte_size,
0N/A size_t min_byte_size,
0N/A int level);
0N/A
0N/A virtual const char* short_name() const { return "ASParNew"; }
0N/A virtual const char* name() const;
0N/A virtual Generation::Name kind() { return ASParNew; }
0N/A
0N/A // Change the sizes of eden and the survivor spaces in
0N/A // the generation. The parameters are desired sizes
0N/A // and are not guaranteed to be met. For example, if
0N/A // the total is larger than the generation.
0N/A void resize(size_t eden_size, size_t survivor_size);
0N/A
0N/A virtual void compute_new_size();
0N/A
0N/A size_t max_gen_size() { return _reserved.byte_size(); }
0N/A size_t min_gen_size() const { return _min_gen_size; }
0N/A
0N/A // Space boundary invariant checker
0N/A void space_invariants() PRODUCT_RETURN;
0N/A};
1879N/A
1879N/A#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP