Mercurial > hg > graal-compiler
annotate src/share/vm/gc_implementation/parallelScavenge/adjoiningGenerations.hpp @ 1656:4e5661ba9d98
6944166: G1: explicit GCs are not always handled correctly
Summary: G1 was not handling explicit GCs correctly in many ways. It does now. See the CR for the list of improvements contained in this changeset.
Reviewed-by: iveresov, ysr, johnc
author | tonyp |
---|---|
date | Mon, 28 Jun 2010 14:13:17 -0400 |
parents | c18cbe5936b8 |
children | f95d63e2154a |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
2 * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 | |
26 // Contains two generations that both use an AdjoiningVirtualSpaces. | |
27 // The two generations are adjacent in the reserved space for the | |
28 // heap. Each generation has a virtual space and shrinking and | |
29 // expanding of the generations can still be down with that | |
30 // virtual space as was previously done. If expanding of reserved | |
31 // size of a generation is required, the adjacent generation | |
32 // must be shrunk. Adjusting the boundary between the generations | |
33 // is called for in this class. | |
34 | |
35 class AdjoiningGenerations : public CHeapObj { | |
36 friend class VMStructs; | |
37 private: | |
38 // The young generation and old generation, respectively | |
39 PSYoungGen* _young_gen; | |
40 PSOldGen* _old_gen; | |
41 | |
42 // The spaces used by the two generations. | |
43 AdjoiningVirtualSpaces _virtual_spaces; | |
44 | |
45 // Move boundary up to expand old gen. Checks are made to | |
46 // determine if the move can be done with specified limits. | |
47 void request_old_gen_expansion(size_t desired_change_in_bytes); | |
48 // Move boundary down to expand young gen. | |
49 bool request_young_gen_expansion(size_t desired_change_in_bytes); | |
50 | |
51 public: | |
52 AdjoiningGenerations(ReservedSpace rs, | |
53 size_t init_low_byte_size, | |
54 size_t min_low_byte_size, | |
55 size_t max_low_byte_size, | |
56 size_t init_high_byte_size, | |
57 size_t min_high_byte_size, | |
58 size_t max_high_bytes_size, | |
59 size_t alignment); | |
60 | |
61 // Accessors | |
62 PSYoungGen* young_gen() { return _young_gen; } | |
63 PSOldGen* old_gen() { return _old_gen; } | |
64 | |
65 AdjoiningVirtualSpaces* virtual_spaces() { return &_virtual_spaces; } | |
66 | |
67 // Additional space is needed in the old generation. Check | |
68 // the available space and attempt to move the boundary if more space | |
69 // is needed. The growth is not guaranteed to occur. | |
70 void adjust_boundary_for_old_gen_needs(size_t desired_change_in_bytes); | |
71 // Similary for a growth of the young generation. | |
72 void adjust_boundary_for_young_gen_needs(size_t eden_size, size_t survivor_size); | |
73 | |
74 // Return the total byte size of the reserved space | |
75 // for the adjoining generations. | |
76 size_t reserved_byte_size(); | |
77 }; |