src/share/vm/gc_implementation/parNew/asParNewGeneration.hpp

Wed, 27 Apr 2016 01:25:04 +0800

author
aoqi
date
Wed, 27 Apr 2016 01:25:04 +0800
changeset 0
f90c822e73f8
child 6876
710a3c8b516e
permissions
-rw-r--r--

Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/
changeset: 6782:28b50d07f6f8
tag: jdk8u25-b17

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation.
aoqi@0 8 *
aoqi@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 * accompanied this code).
aoqi@0 14 *
aoqi@0 15 * You should have received a copy of the GNU General Public License version
aoqi@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 *
aoqi@0 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 * or visit www.oracle.com if you need additional information or have any
aoqi@0 21 * questions.
aoqi@0 22 *
aoqi@0 23 */
aoqi@0 24
aoqi@0 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP
aoqi@0 26 #define SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP
aoqi@0 27
aoqi@0 28 #include "gc_implementation/parNew/parNewGeneration.hpp"
aoqi@0 29 #include "gc_implementation/shared/adaptiveSizePolicy.hpp"
aoqi@0 30
aoqi@0 31 // A Generation that does parallel young-gen collection extended
aoqi@0 32 // for adaptive size policy.
aoqi@0 33
aoqi@0 34 // Division of generation into spaces
aoqi@0 35 // done by DefNewGeneration::compute_space_boundaries()
aoqi@0 36 // +---------------+
aoqi@0 37 // | uncommitted |
aoqi@0 38 // |---------------|
aoqi@0 39 // | ss0 |
aoqi@0 40 // |---------------|
aoqi@0 41 // | ss1 |
aoqi@0 42 // |---------------|
aoqi@0 43 // | |
aoqi@0 44 // | eden |
aoqi@0 45 // | |
aoqi@0 46 // +---------------+ <-- low end of VirtualSpace
aoqi@0 47 //
aoqi@0 48 class ASParNewGeneration: public ParNewGeneration {
aoqi@0 49
aoqi@0 50 size_t _min_gen_size;
aoqi@0 51
aoqi@0 52 // Resize the generation based on the desired sizes of
aoqi@0 53 // the constituent spaces.
aoqi@0 54 bool resize_generation(size_t eden_size, size_t survivor_size);
aoqi@0 55 // Resize the spaces based on their desired sizes but
aoqi@0 56 // respecting the maximum size of the generation.
aoqi@0 57 void resize_spaces(size_t eden_size, size_t survivor_size);
aoqi@0 58 // Return the byte size remaining to the minimum generation size.
aoqi@0 59 size_t available_to_min_gen();
aoqi@0 60 // Return the byte size remaining to the live data in the generation.
aoqi@0 61 size_t available_to_live() const;
aoqi@0 62 // Return the byte size that the generation is allowed to shrink.
aoqi@0 63 size_t limit_gen_shrink(size_t bytes);
aoqi@0 64 // Reset the size of the spaces after a shrink of the generation.
aoqi@0 65 void reset_survivors_after_shrink();
aoqi@0 66
aoqi@0 67 // Accessor
aoqi@0 68 VirtualSpace* virtual_space() { return &_virtual_space; }
aoqi@0 69
aoqi@0 70 virtual void adjust_desired_tenuring_threshold();
aoqi@0 71
aoqi@0 72 public:
aoqi@0 73
aoqi@0 74 ASParNewGeneration(ReservedSpace rs,
aoqi@0 75 size_t initial_byte_size,
aoqi@0 76 size_t min_byte_size,
aoqi@0 77 int level);
aoqi@0 78
aoqi@0 79 virtual const char* short_name() const { return "ASParNew"; }
aoqi@0 80 virtual const char* name() const;
aoqi@0 81 virtual Generation::Name kind() { return ASParNew; }
aoqi@0 82
aoqi@0 83 // Change the sizes of eden and the survivor spaces in
aoqi@0 84 // the generation. The parameters are desired sizes
aoqi@0 85 // and are not guaranteed to be met. For example, if
aoqi@0 86 // the total is larger than the generation.
aoqi@0 87 void resize(size_t eden_size, size_t survivor_size);
aoqi@0 88
aoqi@0 89 virtual void compute_new_size();
aoqi@0 90
aoqi@0 91 size_t max_gen_size() { return _reserved.byte_size(); }
aoqi@0 92 size_t min_gen_size() const { return _min_gen_size; }
aoqi@0 93
aoqi@0 94 // Space boundary invariant checker
aoqi@0 95 void space_invariants() PRODUCT_RETURN;
aoqi@0 96 };
aoqi@0 97
aoqi@0 98 #endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP

mercurial