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

Tue, 10 May 2011 00:33:21 -0700

author
ysr
date
Tue, 10 May 2011 00:33:21 -0700
changeset 2889
fc2b798ab316
parent 2314
f95d63e2154a
child 6876
710a3c8b516e
permissions
-rw-r--r--

6883834: ParNew: assert(!_g->to()->is_in_reserved(obj),"Scanning field twice?") with LargeObjects tests
Summary: Fixed process_chunk_boundaries(), used for parallel card scanning when using ParNew/CMS, so as to prevent double-scanning, or worse, non-scanning of imprecisely marked objects exceeding parallel chunk size. Made some sizing parameters for parallel card scanning diagnostic, disabled ParallelGCRetainPLAB, and elaborated and clarified some comments.
Reviewed-by: stefank, johnc

     1 /*
     2  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    20  * or visit www.oracle.com if you need additional information or have any
    21  * questions.
    22  *
    23  */
    25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP
    26 #define SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP
    28 #include "gc_implementation/parNew/parNewGeneration.hpp"
    29 #include "gc_implementation/shared/adaptiveSizePolicy.hpp"
    31 // A Generation that does parallel young-gen collection extended
    32 // for adaptive size policy.
    34 // Division of generation into spaces
    35 // done by DefNewGeneration::compute_space_boundaries()
    36 //      +---------------+
    37 //      | uncommitted   |
    38 //      |---------------|
    39 //      | ss0           |
    40 //      |---------------|
    41 //      | ss1           |
    42 //      |---------------|
    43 //      |               |
    44 //      | eden          |
    45 //      |               |
    46 //      +---------------+       <-- low end of VirtualSpace
    47 //
    48 class ASParNewGeneration: public ParNewGeneration {
    50   size_t _min_gen_size;
    52   // Resize the generation based on the desired sizes of
    53   // the constituent spaces.
    54   bool resize_generation(size_t eden_size, size_t survivor_size);
    55   // Resize the spaces based on their desired sizes but
    56   // respecting the maximum size of the generation.
    57   void resize_spaces(size_t eden_size, size_t survivor_size);
    58   // Return the byte size remaining to the minimum generation size.
    59   size_t available_to_min_gen();
    60   // Return the byte size remaining to the live data in the generation.
    61   size_t available_to_live() const;
    62   // Return the byte size that the generation is allowed to shrink.
    63   size_t limit_gen_shrink(size_t bytes);
    64   // Reset the size of the spaces after a shrink of the generation.
    65   void reset_survivors_after_shrink();
    67   // Accessor
    68   VirtualSpace* virtual_space() { return &_virtual_space; }
    70   virtual void adjust_desired_tenuring_threshold();
    72  public:
    74   ASParNewGeneration(ReservedSpace rs,
    75                      size_t initial_byte_size,
    76                      size_t min_byte_size,
    77                      int level);
    79   virtual const char* short_name() const { return "ASParNew"; }
    80   virtual const char* name() const;
    81   virtual Generation::Name kind() { return ASParNew; }
    83   // Change the sizes of eden and the survivor spaces in
    84   // the generation.  The parameters are desired sizes
    85   // and are not guaranteed to be met.  For example, if
    86   // the total is larger than the generation.
    87   void resize(size_t eden_size, size_t survivor_size);
    89   virtual void compute_new_size();
    91   size_t max_gen_size()                 { return _reserved.byte_size(); }
    92   size_t min_gen_size() const           { return _min_gen_size; }
    94   // Space boundary invariant checker
    95   void space_invariants() PRODUCT_RETURN;
    96 };
    98 #endif // SHARE_VM_GC_IMPLEMENTATION_PARNEW_ASPARNEWGENERATION_HPP

mercurial