1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/vm/gc_implementation/parNew/asParNewGeneration.hpp Wed Apr 27 01:25:04 2016 +0800 1.3 @@ -0,0 +1,98 @@ 1.4 +/* 1.5 + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 + * or visit www.oracle.com if you need additional information or have any 1.24 + * questions. 1.25 + * 1.26 + */ 1.27 + 1.28 +#ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP 1.29 +#define SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP 1.30 + 1.31 +#include "gc_implementation/parNew/parNewGeneration.hpp" 1.32 +#include "gc_implementation/shared/adaptiveSizePolicy.hpp" 1.33 + 1.34 +// A Generation that does parallel young-gen collection extended 1.35 +// for adaptive size policy. 1.36 + 1.37 +// Division of generation into spaces 1.38 +// done by DefNewGeneration::compute_space_boundaries() 1.39 +// +---------------+ 1.40 +// | uncommitted | 1.41 +// |---------------| 1.42 +// | ss0 | 1.43 +// |---------------| 1.44 +// | ss1 | 1.45 +// |---------------| 1.46 +// | | 1.47 +// | eden | 1.48 +// | | 1.49 +// +---------------+ <-- low end of VirtualSpace 1.50 +// 1.51 +class ASParNewGeneration: public ParNewGeneration { 1.52 + 1.53 + size_t _min_gen_size; 1.54 + 1.55 + // Resize the generation based on the desired sizes of 1.56 + // the constituent spaces. 1.57 + bool resize_generation(size_t eden_size, size_t survivor_size); 1.58 + // Resize the spaces based on their desired sizes but 1.59 + // respecting the maximum size of the generation. 1.60 + void resize_spaces(size_t eden_size, size_t survivor_size); 1.61 + // Return the byte size remaining to the minimum generation size. 1.62 + size_t available_to_min_gen(); 1.63 + // Return the byte size remaining to the live data in the generation. 1.64 + size_t available_to_live() const; 1.65 + // Return the byte size that the generation is allowed to shrink. 1.66 + size_t limit_gen_shrink(size_t bytes); 1.67 + // Reset the size of the spaces after a shrink of the generation. 1.68 + void reset_survivors_after_shrink(); 1.69 + 1.70 + // Accessor 1.71 + VirtualSpace* virtual_space() { return &_virtual_space; } 1.72 + 1.73 + virtual void adjust_desired_tenuring_threshold(); 1.74 + 1.75 + public: 1.76 + 1.77 + ASParNewGeneration(ReservedSpace rs, 1.78 + size_t initial_byte_size, 1.79 + size_t min_byte_size, 1.80 + int level); 1.81 + 1.82 + virtual const char* short_name() const { return "ASParNew"; } 1.83 + virtual const char* name() const; 1.84 + virtual Generation::Name kind() { return ASParNew; } 1.85 + 1.86 + // Change the sizes of eden and the survivor spaces in 1.87 + // the generation. The parameters are desired sizes 1.88 + // and are not guaranteed to be met. For example, if 1.89 + // the total is larger than the generation. 1.90 + void resize(size_t eden_size, size_t survivor_size); 1.91 + 1.92 + virtual void compute_new_size(); 1.93 + 1.94 + size_t max_gen_size() { return _reserved.byte_size(); } 1.95 + size_t min_gen_size() const { return _min_gen_size; } 1.96 + 1.97 + // Space boundary invariant checker 1.98 + void space_invariants() PRODUCT_RETURN; 1.99 +}; 1.100 + 1.101 +#endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP