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

Mon, 26 Jan 2009 12:47:21 -0800

author
ysr
date
Mon, 26 Jan 2009 12:47:21 -0800
changeset 969
5cfd8d19e546
parent 435
a61af66fc99e
child 1907
c18cbe5936b8
permissions
-rw-r--r--

6786503: Overflow list performance can be improved
Summary: Avoid overflow list walk in CMS & ParNew when it is unnecessary. Fix a couple of correctness issues, including a C-heap leak, in ParNew at the intersection of promotion failure, work queue overflow and object array chunking. Add stress testing option and related assertion checking.
Reviewed-by: jmasa

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

mercurial