src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp

changeset 435
a61af66fc99e
child 1907
c18cbe5936b8
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp	Sat Dec 01 00:00:00 2007 +0000
     1.3 @@ -0,0 +1,77 @@
     1.4 +/*
     1.5 + * Copyright 2003 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    1.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
    1.24 + * have any questions.
    1.25 + *
    1.26 + */
    1.27 +
    1.28 +
    1.29 +// Contains two generations that both use an AdjoiningVirtualSpaces.
    1.30 +// The two generations are adjacent in the reserved space for the
    1.31 +// heap.  Each generation has a virtual space and shrinking and
    1.32 +// expanding of the generations can still be down with that
    1.33 +// virtual space as was previously done.  If expanding of reserved
    1.34 +// size of a generation is required, the adjacent generation
    1.35 +// must be shrunk.  Adjusting the boundary between the generations
    1.36 +// is called for in this class.
    1.37 +
    1.38 +class AdjoiningGenerations : public CHeapObj {
    1.39 +  friend class VMStructs;
    1.40 + private:
    1.41 +  // The young generation and old generation, respectively
    1.42 +  PSYoungGen* _young_gen;
    1.43 +  PSOldGen* _old_gen;
    1.44 +
    1.45 +  // The spaces used by the two generations.
    1.46 +  AdjoiningVirtualSpaces _virtual_spaces;
    1.47 +
    1.48 +  // Move boundary up to expand old gen.  Checks are made to
    1.49 +  // determine if the move can be done with specified limits.
    1.50 +  void request_old_gen_expansion(size_t desired_change_in_bytes);
    1.51 +  // Move boundary down to expand young gen.
    1.52 +  bool request_young_gen_expansion(size_t desired_change_in_bytes);
    1.53 +
    1.54 + public:
    1.55 +  AdjoiningGenerations(ReservedSpace rs,
    1.56 +                       size_t init_low_byte_size,
    1.57 +                       size_t min_low_byte_size,
    1.58 +                       size_t max_low_byte_size,
    1.59 +                       size_t init_high_byte_size,
    1.60 +                       size_t min_high_byte_size,
    1.61 +                       size_t max_high_bytes_size,
    1.62 +                       size_t alignment);
    1.63 +
    1.64 +  // Accessors
    1.65 +  PSYoungGen* young_gen() { return _young_gen; }
    1.66 +  PSOldGen* old_gen() { return _old_gen; }
    1.67 +
    1.68 +  AdjoiningVirtualSpaces* virtual_spaces() { return &_virtual_spaces; }
    1.69 +
    1.70 +  // Additional space is needed in the old generation.  Check
    1.71 +  // the available space and attempt to move the boundary if more space
    1.72 +  // is needed.  The growth is not guaranteed to occur.
    1.73 +  void adjust_boundary_for_old_gen_needs(size_t desired_change_in_bytes);
    1.74 +  // Similary for a growth of the young generation.
    1.75 +  void adjust_boundary_for_young_gen_needs(size_t eden_size, size_t survivor_size);
    1.76 +
    1.77 +  // Return the total byte size of the reserved space
    1.78 +  // for the adjoining generations.
    1.79 +  size_t reserved_byte_size();
    1.80 +};

mercurial