annotate src/share/vm/gc_implementation/parallelScavenge/asPSYoungGen.cpp @ 196:d1605aabd0a1 jdk7-b30

6719955: Update copyright year Summary: Update copyright year for files that have been modified in 2008 Reviewed-by: ohair, tbell
author xdono
date Wed, 02 Jul 2008 12:55:16 -0700
parents 183f41cf8bfe
children 850fdf70db2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
196
d1605aabd0a1 6719955: Update copyright year
xdono
parents: 13
diff changeset
2 * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 # include "incls/_precompiled.incl"
a61af66fc99e Initial load
duke
parents:
diff changeset
26 # include "incls/_asPSYoungGen.cpp.incl"
a61af66fc99e Initial load
duke
parents:
diff changeset
27
a61af66fc99e Initial load
duke
parents:
diff changeset
28 ASPSYoungGen::ASPSYoungGen(size_t init_byte_size,
a61af66fc99e Initial load
duke
parents:
diff changeset
29 size_t minimum_byte_size,
a61af66fc99e Initial load
duke
parents:
diff changeset
30 size_t byte_size_limit) :
a61af66fc99e Initial load
duke
parents:
diff changeset
31 PSYoungGen(init_byte_size, minimum_byte_size, byte_size_limit),
a61af66fc99e Initial load
duke
parents:
diff changeset
32 _gen_size_limit(byte_size_limit) {
a61af66fc99e Initial load
duke
parents:
diff changeset
33 }
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35
a61af66fc99e Initial load
duke
parents:
diff changeset
36 ASPSYoungGen::ASPSYoungGen(PSVirtualSpace* vs,
a61af66fc99e Initial load
duke
parents:
diff changeset
37 size_t init_byte_size,
a61af66fc99e Initial load
duke
parents:
diff changeset
38 size_t minimum_byte_size,
a61af66fc99e Initial load
duke
parents:
diff changeset
39 size_t byte_size_limit) :
a61af66fc99e Initial load
duke
parents:
diff changeset
40 //PSYoungGen(init_byte_size, minimum_byte_size, byte_size_limit),
a61af66fc99e Initial load
duke
parents:
diff changeset
41 PSYoungGen(vs->committed_size(), minimum_byte_size, byte_size_limit),
a61af66fc99e Initial load
duke
parents:
diff changeset
42 _gen_size_limit(byte_size_limit) {
a61af66fc99e Initial load
duke
parents:
diff changeset
43
a61af66fc99e Initial load
duke
parents:
diff changeset
44 assert(vs->committed_size() == init_byte_size, "Cannot replace with");
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 _virtual_space = vs;
a61af66fc99e Initial load
duke
parents:
diff changeset
47 }
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 void ASPSYoungGen::initialize_virtual_space(ReservedSpace rs,
a61af66fc99e Initial load
duke
parents:
diff changeset
50 size_t alignment) {
a61af66fc99e Initial load
duke
parents:
diff changeset
51 assert(_init_gen_size != 0, "Should have a finite size");
a61af66fc99e Initial load
duke
parents:
diff changeset
52 _virtual_space = new PSVirtualSpaceHighToLow(rs, alignment);
a61af66fc99e Initial load
duke
parents:
diff changeset
53 if (!_virtual_space->expand_by(_init_gen_size)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
54 vm_exit_during_initialization("Could not reserve enough space for "
a61af66fc99e Initial load
duke
parents:
diff changeset
55 "object heap");
a61af66fc99e Initial load
duke
parents:
diff changeset
56 }
a61af66fc99e Initial load
duke
parents:
diff changeset
57 }
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 void ASPSYoungGen::initialize(ReservedSpace rs, size_t alignment) {
a61af66fc99e Initial load
duke
parents:
diff changeset
60 initialize_virtual_space(rs, alignment);
a61af66fc99e Initial load
duke
parents:
diff changeset
61 initialize_work();
a61af66fc99e Initial load
duke
parents:
diff changeset
62 }
a61af66fc99e Initial load
duke
parents:
diff changeset
63
a61af66fc99e Initial load
duke
parents:
diff changeset
64 size_t ASPSYoungGen::available_for_expansion() {
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66 size_t current_committed_size = virtual_space()->committed_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
67 assert((gen_size_limit() >= current_committed_size),
a61af66fc99e Initial load
duke
parents:
diff changeset
68 "generation size limit is wrong");
a61af66fc99e Initial load
duke
parents:
diff changeset
69 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
a61af66fc99e Initial load
duke
parents:
diff changeset
70 size_t result = gen_size_limit() - current_committed_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 size_t result_aligned = align_size_down(result, heap->young_gen_alignment());
a61af66fc99e Initial load
duke
parents:
diff changeset
72 return result_aligned;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 }
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75 // Return the number of bytes the young gen is willing give up.
a61af66fc99e Initial load
duke
parents:
diff changeset
76 //
a61af66fc99e Initial load
duke
parents:
diff changeset
77 // Future implementations could check the survivors and if to_space is in the
a61af66fc99e Initial load
duke
parents:
diff changeset
78 // right place (below from_space), take a chunk from to_space.
a61af66fc99e Initial load
duke
parents:
diff changeset
79 size_t ASPSYoungGen::available_for_contraction() {
a61af66fc99e Initial load
duke
parents:
diff changeset
80
a61af66fc99e Initial load
duke
parents:
diff changeset
81 size_t uncommitted_bytes = virtual_space()->uncommitted_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
82 if (uncommitted_bytes != 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
83 return uncommitted_bytes;
a61af66fc99e Initial load
duke
parents:
diff changeset
84 }
a61af66fc99e Initial load
duke
parents:
diff changeset
85
a61af66fc99e Initial load
duke
parents:
diff changeset
86 if (eden_space()->is_empty()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
87 // Respect the minimum size for eden and for the young gen as a whole.
a61af66fc99e Initial load
duke
parents:
diff changeset
88 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
13
183f41cf8bfe 6557851: CMS: ergonomics defaults are not set with FLAG_SET_ERGO
jmasa
parents: 0
diff changeset
89 const size_t eden_alignment = heap->intra_heap_alignment();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
90 const size_t gen_alignment = heap->young_gen_alignment();
a61af66fc99e Initial load
duke
parents:
diff changeset
91
a61af66fc99e Initial load
duke
parents:
diff changeset
92 assert(eden_space()->capacity_in_bytes() >= eden_alignment,
a61af66fc99e Initial load
duke
parents:
diff changeset
93 "Alignment is wrong");
a61af66fc99e Initial load
duke
parents:
diff changeset
94 size_t eden_avail = eden_space()->capacity_in_bytes() - eden_alignment;
a61af66fc99e Initial load
duke
parents:
diff changeset
95 eden_avail = align_size_down(eden_avail, gen_alignment);
a61af66fc99e Initial load
duke
parents:
diff changeset
96
a61af66fc99e Initial load
duke
parents:
diff changeset
97 assert(virtual_space()->committed_size() >= min_gen_size(),
a61af66fc99e Initial load
duke
parents:
diff changeset
98 "minimum gen size is wrong");
a61af66fc99e Initial load
duke
parents:
diff changeset
99 size_t gen_avail = virtual_space()->committed_size() - min_gen_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
100 assert(virtual_space()->is_aligned(gen_avail), "not aligned");
a61af66fc99e Initial load
duke
parents:
diff changeset
101
a61af66fc99e Initial load
duke
parents:
diff changeset
102 const size_t max_contraction = MIN2(eden_avail, gen_avail);
a61af66fc99e Initial load
duke
parents:
diff changeset
103 // See comment for ASPSOldGen::available_for_contraction()
a61af66fc99e Initial load
duke
parents:
diff changeset
104 // for reasons the "increment" fraction is used.
a61af66fc99e Initial load
duke
parents:
diff changeset
105 PSAdaptiveSizePolicy* policy = heap->size_policy();
a61af66fc99e Initial load
duke
parents:
diff changeset
106 size_t result = policy->eden_increment_aligned_down(max_contraction);
a61af66fc99e Initial load
duke
parents:
diff changeset
107 size_t result_aligned = align_size_down(result, gen_alignment);
a61af66fc99e Initial load
duke
parents:
diff changeset
108 if (PrintAdaptiveSizePolicy && Verbose) {
a61af66fc99e Initial load
duke
parents:
diff changeset
109 gclog_or_tty->print_cr("ASPSYoungGen::available_for_contraction: %d K",
a61af66fc99e Initial load
duke
parents:
diff changeset
110 result_aligned/K);
a61af66fc99e Initial load
duke
parents:
diff changeset
111 gclog_or_tty->print_cr(" max_contraction %d K", max_contraction/K);
a61af66fc99e Initial load
duke
parents:
diff changeset
112 gclog_or_tty->print_cr(" eden_avail %d K", eden_avail/K);
a61af66fc99e Initial load
duke
parents:
diff changeset
113 gclog_or_tty->print_cr(" gen_avail %d K", gen_avail/K);
a61af66fc99e Initial load
duke
parents:
diff changeset
114 }
a61af66fc99e Initial load
duke
parents:
diff changeset
115 return result_aligned;
a61af66fc99e Initial load
duke
parents:
diff changeset
116
a61af66fc99e Initial load
duke
parents:
diff changeset
117 }
a61af66fc99e Initial load
duke
parents:
diff changeset
118
a61af66fc99e Initial load
duke
parents:
diff changeset
119 return 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
120 }
a61af66fc99e Initial load
duke
parents:
diff changeset
121
a61af66fc99e Initial load
duke
parents:
diff changeset
122 // The current implementation only considers to the end of eden.
a61af66fc99e Initial load
duke
parents:
diff changeset
123 // If to_space is below from_space, to_space is not considered.
a61af66fc99e Initial load
duke
parents:
diff changeset
124 // to_space can be.
a61af66fc99e Initial load
duke
parents:
diff changeset
125 size_t ASPSYoungGen::available_to_live() {
a61af66fc99e Initial load
duke
parents:
diff changeset
126 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
13
183f41cf8bfe 6557851: CMS: ergonomics defaults are not set with FLAG_SET_ERGO
jmasa
parents: 0
diff changeset
127 const size_t alignment = heap->intra_heap_alignment();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129 // Include any space that is committed but is not in eden.
a61af66fc99e Initial load
duke
parents:
diff changeset
130 size_t available = pointer_delta(eden_space()->bottom(),
a61af66fc99e Initial load
duke
parents:
diff changeset
131 virtual_space()->low(),
a61af66fc99e Initial load
duke
parents:
diff changeset
132 sizeof(char));
a61af66fc99e Initial load
duke
parents:
diff changeset
133
a61af66fc99e Initial load
duke
parents:
diff changeset
134 const size_t eden_capacity = eden_space()->capacity_in_bytes();
a61af66fc99e Initial load
duke
parents:
diff changeset
135 if (eden_space()->is_empty() && eden_capacity > alignment) {
a61af66fc99e Initial load
duke
parents:
diff changeset
136 available += eden_capacity - alignment;
a61af66fc99e Initial load
duke
parents:
diff changeset
137 }
a61af66fc99e Initial load
duke
parents:
diff changeset
138 return available;
a61af66fc99e Initial load
duke
parents:
diff changeset
139 }
a61af66fc99e Initial load
duke
parents:
diff changeset
140
a61af66fc99e Initial load
duke
parents:
diff changeset
141 // Similar to PSYoungGen::resize_generation() but
a61af66fc99e Initial load
duke
parents:
diff changeset
142 // allows sum of eden_size and 2 * survivor_size to exceed _max_gen_size
a61af66fc99e Initial load
duke
parents:
diff changeset
143 // expands at the low end of the virtual space
a61af66fc99e Initial load
duke
parents:
diff changeset
144 // moves the boundary between the generations in order to expand
a61af66fc99e Initial load
duke
parents:
diff changeset
145 // some additional diagnostics
a61af66fc99e Initial load
duke
parents:
diff changeset
146 // If no additional changes are required, this can be deleted
a61af66fc99e Initial load
duke
parents:
diff changeset
147 // and the changes factored back into PSYoungGen::resize_generation().
a61af66fc99e Initial load
duke
parents:
diff changeset
148 bool ASPSYoungGen::resize_generation(size_t eden_size, size_t survivor_size) {
a61af66fc99e Initial load
duke
parents:
diff changeset
149 const size_t alignment = virtual_space()->alignment();
a61af66fc99e Initial load
duke
parents:
diff changeset
150 size_t orig_size = virtual_space()->committed_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
151 bool size_changed = false;
a61af66fc99e Initial load
duke
parents:
diff changeset
152
a61af66fc99e Initial load
duke
parents:
diff changeset
153 // There used to be a guarantee here that
a61af66fc99e Initial load
duke
parents:
diff changeset
154 // (eden_size + 2*survivor_size) <= _max_gen_size
a61af66fc99e Initial load
duke
parents:
diff changeset
155 // This requirement is enforced by the calculation of desired_size
a61af66fc99e Initial load
duke
parents:
diff changeset
156 // below. It may not be true on entry since the size of the
a61af66fc99e Initial load
duke
parents:
diff changeset
157 // eden_size is no bounded by the generation size.
a61af66fc99e Initial load
duke
parents:
diff changeset
158
a61af66fc99e Initial load
duke
parents:
diff changeset
159 assert(max_size() == reserved().byte_size(), "max gen size problem?");
a61af66fc99e Initial load
duke
parents:
diff changeset
160 assert(min_gen_size() <= orig_size && orig_size <= max_size(),
a61af66fc99e Initial load
duke
parents:
diff changeset
161 "just checking");
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 // Adjust new generation size
a61af66fc99e Initial load
duke
parents:
diff changeset
164 const size_t eden_plus_survivors =
a61af66fc99e Initial load
duke
parents:
diff changeset
165 align_size_up(eden_size + 2 * survivor_size, alignment);
a61af66fc99e Initial load
duke
parents:
diff changeset
166 size_t desired_size = MAX2(MIN2(eden_plus_survivors, gen_size_limit()),
a61af66fc99e Initial load
duke
parents:
diff changeset
167 min_gen_size());
a61af66fc99e Initial load
duke
parents:
diff changeset
168 assert(desired_size <= gen_size_limit(), "just checking");
a61af66fc99e Initial load
duke
parents:
diff changeset
169
a61af66fc99e Initial load
duke
parents:
diff changeset
170 if (desired_size > orig_size) {
a61af66fc99e Initial load
duke
parents:
diff changeset
171 // Grow the generation
a61af66fc99e Initial load
duke
parents:
diff changeset
172 size_t change = desired_size - orig_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
173 if (!virtual_space()->expand_by(change)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
174 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
175 }
a61af66fc99e Initial load
duke
parents:
diff changeset
176 size_changed = true;
a61af66fc99e Initial load
duke
parents:
diff changeset
177 } else if (desired_size < orig_size) {
a61af66fc99e Initial load
duke
parents:
diff changeset
178 size_t desired_change = orig_size - desired_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
179
a61af66fc99e Initial load
duke
parents:
diff changeset
180 // How much is available for shrinking.
a61af66fc99e Initial load
duke
parents:
diff changeset
181 size_t available_bytes = limit_gen_shrink(desired_change);
a61af66fc99e Initial load
duke
parents:
diff changeset
182 size_t change = MIN2(desired_change, available_bytes);
a61af66fc99e Initial load
duke
parents:
diff changeset
183 virtual_space()->shrink_by(change);
a61af66fc99e Initial load
duke
parents:
diff changeset
184 size_changed = true;
a61af66fc99e Initial load
duke
parents:
diff changeset
185 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
186 if (Verbose && PrintGC) {
a61af66fc99e Initial load
duke
parents:
diff changeset
187 if (orig_size == gen_size_limit()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
188 gclog_or_tty->print_cr("ASPSYoung generation size at maximum: "
a61af66fc99e Initial load
duke
parents:
diff changeset
189 SIZE_FORMAT "K", orig_size/K);
a61af66fc99e Initial load
duke
parents:
diff changeset
190 } else if (orig_size == min_gen_size()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
191 gclog_or_tty->print_cr("ASPSYoung generation size at minium: "
a61af66fc99e Initial load
duke
parents:
diff changeset
192 SIZE_FORMAT "K", orig_size/K);
a61af66fc99e Initial load
duke
parents:
diff changeset
193 }
a61af66fc99e Initial load
duke
parents:
diff changeset
194 }
a61af66fc99e Initial load
duke
parents:
diff changeset
195 }
a61af66fc99e Initial load
duke
parents:
diff changeset
196
a61af66fc99e Initial load
duke
parents:
diff changeset
197 if (size_changed) {
a61af66fc99e Initial load
duke
parents:
diff changeset
198 reset_after_change();
a61af66fc99e Initial load
duke
parents:
diff changeset
199 if (Verbose && PrintGC) {
a61af66fc99e Initial load
duke
parents:
diff changeset
200 size_t current_size = virtual_space()->committed_size();
a61af66fc99e Initial load
duke
parents:
diff changeset
201 gclog_or_tty->print_cr("ASPSYoung generation size changed: "
a61af66fc99e Initial load
duke
parents:
diff changeset
202 SIZE_FORMAT "K->" SIZE_FORMAT "K",
a61af66fc99e Initial load
duke
parents:
diff changeset
203 orig_size/K, current_size/K);
a61af66fc99e Initial load
duke
parents:
diff changeset
204 }
a61af66fc99e Initial load
duke
parents:
diff changeset
205 }
a61af66fc99e Initial load
duke
parents:
diff changeset
206
a61af66fc99e Initial load
duke
parents:
diff changeset
207 guarantee(eden_plus_survivors <= virtual_space()->committed_size() ||
a61af66fc99e Initial load
duke
parents:
diff changeset
208 virtual_space()->committed_size() == max_size(), "Sanity");
a61af66fc99e Initial load
duke
parents:
diff changeset
209
a61af66fc99e Initial load
duke
parents:
diff changeset
210 return true;
a61af66fc99e Initial load
duke
parents:
diff changeset
211 }
a61af66fc99e Initial load
duke
parents:
diff changeset
212
a61af66fc99e Initial load
duke
parents:
diff changeset
213 // Similar to PSYoungGen::resize_spaces() but
a61af66fc99e Initial load
duke
parents:
diff changeset
214 // eden always starts at the low end of the committed virtual space
a61af66fc99e Initial load
duke
parents:
diff changeset
215 // current implementation does not allow holes between the spaces
a61af66fc99e Initial load
duke
parents:
diff changeset
216 // _young_generation_boundary has to be reset because it changes.
a61af66fc99e Initial load
duke
parents:
diff changeset
217 // so additional verification
a61af66fc99e Initial load
duke
parents:
diff changeset
218 void ASPSYoungGen::resize_spaces(size_t requested_eden_size,
a61af66fc99e Initial load
duke
parents:
diff changeset
219 size_t requested_survivor_size) {
a61af66fc99e Initial load
duke
parents:
diff changeset
220 assert(requested_eden_size > 0 && requested_survivor_size > 0,
a61af66fc99e Initial load
duke
parents:
diff changeset
221 "just checking");
a61af66fc99e Initial load
duke
parents:
diff changeset
222
a61af66fc99e Initial load
duke
parents:
diff changeset
223 space_invariants();
a61af66fc99e Initial load
duke
parents:
diff changeset
224
a61af66fc99e Initial load
duke
parents:
diff changeset
225 // We require eden and to space to be empty
a61af66fc99e Initial load
duke
parents:
diff changeset
226 if ((!eden_space()->is_empty()) || (!to_space()->is_empty())) {
a61af66fc99e Initial load
duke
parents:
diff changeset
227 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
228 }
a61af66fc99e Initial load
duke
parents:
diff changeset
229
a61af66fc99e Initial load
duke
parents:
diff changeset
230 if (PrintAdaptiveSizePolicy && Verbose) {
a61af66fc99e Initial load
duke
parents:
diff changeset
231 gclog_or_tty->print_cr("PSYoungGen::resize_spaces(requested_eden_size: "
a61af66fc99e Initial load
duke
parents:
diff changeset
232 SIZE_FORMAT
a61af66fc99e Initial load
duke
parents:
diff changeset
233 ", requested_survivor_size: " SIZE_FORMAT ")",
a61af66fc99e Initial load
duke
parents:
diff changeset
234 requested_eden_size, requested_survivor_size);
a61af66fc99e Initial load
duke
parents:
diff changeset
235 gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") "
a61af66fc99e Initial load
duke
parents:
diff changeset
236 SIZE_FORMAT,
a61af66fc99e Initial load
duke
parents:
diff changeset
237 eden_space()->bottom(),
a61af66fc99e Initial load
duke
parents:
diff changeset
238 eden_space()->end(),
a61af66fc99e Initial load
duke
parents:
diff changeset
239 pointer_delta(eden_space()->end(),
a61af66fc99e Initial load
duke
parents:
diff changeset
240 eden_space()->bottom(),
a61af66fc99e Initial load
duke
parents:
diff changeset
241 sizeof(char)));
a61af66fc99e Initial load
duke
parents:
diff changeset
242 gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") "
a61af66fc99e Initial load
duke
parents:
diff changeset
243 SIZE_FORMAT,
a61af66fc99e Initial load
duke
parents:
diff changeset
244 from_space()->bottom(),
a61af66fc99e Initial load
duke
parents:
diff changeset
245 from_space()->end(),
a61af66fc99e Initial load
duke
parents:
diff changeset
246 pointer_delta(from_space()->end(),
a61af66fc99e Initial load
duke
parents:
diff changeset
247 from_space()->bottom(),
a61af66fc99e Initial load
duke
parents:
diff changeset
248 sizeof(char)));
a61af66fc99e Initial load
duke
parents:
diff changeset
249 gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") "
a61af66fc99e Initial load
duke
parents:
diff changeset
250 SIZE_FORMAT,
a61af66fc99e Initial load
duke
parents:
diff changeset
251 to_space()->bottom(),
a61af66fc99e Initial load
duke
parents:
diff changeset
252 to_space()->end(),
a61af66fc99e Initial load
duke
parents:
diff changeset
253 pointer_delta( to_space()->end(),
a61af66fc99e Initial load
duke
parents:
diff changeset
254 to_space()->bottom(),
a61af66fc99e Initial load
duke
parents:
diff changeset
255 sizeof(char)));
a61af66fc99e Initial load
duke
parents:
diff changeset
256 }
a61af66fc99e Initial load
duke
parents:
diff changeset
257
a61af66fc99e Initial load
duke
parents:
diff changeset
258 // There's nothing to do if the new sizes are the same as the current
a61af66fc99e Initial load
duke
parents:
diff changeset
259 if (requested_survivor_size == to_space()->capacity_in_bytes() &&
a61af66fc99e Initial load
duke
parents:
diff changeset
260 requested_survivor_size == from_space()->capacity_in_bytes() &&
a61af66fc99e Initial load
duke
parents:
diff changeset
261 requested_eden_size == eden_space()->capacity_in_bytes()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
262 if (PrintAdaptiveSizePolicy && Verbose) {
a61af66fc99e Initial load
duke
parents:
diff changeset
263 gclog_or_tty->print_cr(" capacities are the right sizes, returning");
a61af66fc99e Initial load
duke
parents:
diff changeset
264 }
a61af66fc99e Initial load
duke
parents:
diff changeset
265 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
266 }
a61af66fc99e Initial load
duke
parents:
diff changeset
267
a61af66fc99e Initial load
duke
parents:
diff changeset
268 char* eden_start = (char*)virtual_space()->low();
a61af66fc99e Initial load
duke
parents:
diff changeset
269 char* eden_end = (char*)eden_space()->end();
a61af66fc99e Initial load
duke
parents:
diff changeset
270 char* from_start = (char*)from_space()->bottom();
a61af66fc99e Initial load
duke
parents:
diff changeset
271 char* from_end = (char*)from_space()->end();
a61af66fc99e Initial load
duke
parents:
diff changeset
272 char* to_start = (char*)to_space()->bottom();
a61af66fc99e Initial load
duke
parents:
diff changeset
273 char* to_end = (char*)to_space()->end();
a61af66fc99e Initial load
duke
parents:
diff changeset
274
a61af66fc99e Initial load
duke
parents:
diff changeset
275 assert(eden_start < from_start, "Cannot push into from_space");
a61af66fc99e Initial load
duke
parents:
diff changeset
276
a61af66fc99e Initial load
duke
parents:
diff changeset
277 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
13
183f41cf8bfe 6557851: CMS: ergonomics defaults are not set with FLAG_SET_ERGO
jmasa
parents: 0
diff changeset
278 const size_t alignment = heap->intra_heap_alignment();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
279
a61af66fc99e Initial load
duke
parents:
diff changeset
280 // Check whether from space is below to space
a61af66fc99e Initial load
duke
parents:
diff changeset
281 if (from_start < to_start) {
a61af66fc99e Initial load
duke
parents:
diff changeset
282 // Eden, from, to
a61af66fc99e Initial load
duke
parents:
diff changeset
283 if (PrintAdaptiveSizePolicy && Verbose) {
a61af66fc99e Initial load
duke
parents:
diff changeset
284 gclog_or_tty->print_cr(" Eden, from, to:");
a61af66fc99e Initial load
duke
parents:
diff changeset
285 }
a61af66fc99e Initial load
duke
parents:
diff changeset
286
a61af66fc99e Initial load
duke
parents:
diff changeset
287 // Set eden
a61af66fc99e Initial load
duke
parents:
diff changeset
288 // Compute how big eden can be, then adjust end.
a61af66fc99e Initial load
duke
parents:
diff changeset
289 // See comment in PSYoungGen::resize_spaces() on
a61af66fc99e Initial load
duke
parents:
diff changeset
290 // calculating eden_end.
a61af66fc99e Initial load
duke
parents:
diff changeset
291 const size_t eden_size = MIN2(requested_eden_size,
a61af66fc99e Initial load
duke
parents:
diff changeset
292 pointer_delta(from_start,
a61af66fc99e Initial load
duke
parents:
diff changeset
293 eden_start,
a61af66fc99e Initial load
duke
parents:
diff changeset
294 sizeof(char)));
a61af66fc99e Initial load
duke
parents:
diff changeset
295 eden_end = eden_start + eden_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
296 assert(eden_end >= eden_start, "addition overflowed")
a61af66fc99e Initial load
duke
parents:
diff changeset
297
a61af66fc99e Initial load
duke
parents:
diff changeset
298 // To may resize into from space as long as it is clear of live data.
a61af66fc99e Initial load
duke
parents:
diff changeset
299 // From space must remain page aligned, though, so we need to do some
a61af66fc99e Initial load
duke
parents:
diff changeset
300 // extra calculations.
a61af66fc99e Initial load
duke
parents:
diff changeset
301
a61af66fc99e Initial load
duke
parents:
diff changeset
302 // First calculate an optimal to-space
a61af66fc99e Initial load
duke
parents:
diff changeset
303 to_end = (char*)virtual_space()->high();
a61af66fc99e Initial load
duke
parents:
diff changeset
304 to_start = (char*)pointer_delta(to_end,
a61af66fc99e Initial load
duke
parents:
diff changeset
305 (char*)requested_survivor_size,
a61af66fc99e Initial load
duke
parents:
diff changeset
306 sizeof(char));
a61af66fc99e Initial load
duke
parents:
diff changeset
307
a61af66fc99e Initial load
duke
parents:
diff changeset
308 // Does the optimal to-space overlap from-space?
a61af66fc99e Initial load
duke
parents:
diff changeset
309 if (to_start < (char*)from_space()->end()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
310 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
a61af66fc99e Initial load
duke
parents:
diff changeset
311
a61af66fc99e Initial load
duke
parents:
diff changeset
312 // Calculate the minimum offset possible for from_end
a61af66fc99e Initial load
duke
parents:
diff changeset
313 size_t from_size =
a61af66fc99e Initial load
duke
parents:
diff changeset
314 pointer_delta(from_space()->top(), from_start, sizeof(char));
a61af66fc99e Initial load
duke
parents:
diff changeset
315
a61af66fc99e Initial load
duke
parents:
diff changeset
316 // Should we be in this method if from_space is empty? Why not the set_space method? FIX ME!
a61af66fc99e Initial load
duke
parents:
diff changeset
317 if (from_size == 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
318 from_size = alignment;
a61af66fc99e Initial load
duke
parents:
diff changeset
319 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
320 from_size = align_size_up(from_size, alignment);
a61af66fc99e Initial load
duke
parents:
diff changeset
321 }
a61af66fc99e Initial load
duke
parents:
diff changeset
322
a61af66fc99e Initial load
duke
parents:
diff changeset
323 from_end = from_start + from_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
324 assert(from_end > from_start, "addition overflow or from_size problem");
a61af66fc99e Initial load
duke
parents:
diff changeset
325
a61af66fc99e Initial load
duke
parents:
diff changeset
326 guarantee(from_end <= (char*)from_space()->end(),
a61af66fc99e Initial load
duke
parents:
diff changeset
327 "from_end moved to the right");
a61af66fc99e Initial load
duke
parents:
diff changeset
328
a61af66fc99e Initial load
duke
parents:
diff changeset
329 // Now update to_start with the new from_end
a61af66fc99e Initial load
duke
parents:
diff changeset
330 to_start = MAX2(from_end, to_start);
a61af66fc99e Initial load
duke
parents:
diff changeset
331 }
a61af66fc99e Initial load
duke
parents:
diff changeset
332
a61af66fc99e Initial load
duke
parents:
diff changeset
333 guarantee(to_start != to_end, "to space is zero sized");
a61af66fc99e Initial load
duke
parents:
diff changeset
334
a61af66fc99e Initial load
duke
parents:
diff changeset
335 if (PrintAdaptiveSizePolicy && Verbose) {
a61af66fc99e Initial load
duke
parents:
diff changeset
336 gclog_or_tty->print_cr(" [eden_start .. eden_end): "
a61af66fc99e Initial load
duke
parents:
diff changeset
337 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
a61af66fc99e Initial load
duke
parents:
diff changeset
338 eden_start,
a61af66fc99e Initial load
duke
parents:
diff changeset
339 eden_end,
a61af66fc99e Initial load
duke
parents:
diff changeset
340 pointer_delta(eden_end, eden_start, sizeof(char)));
a61af66fc99e Initial load
duke
parents:
diff changeset
341 gclog_or_tty->print_cr(" [from_start .. from_end): "
a61af66fc99e Initial load
duke
parents:
diff changeset
342 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
a61af66fc99e Initial load
duke
parents:
diff changeset
343 from_start,
a61af66fc99e Initial load
duke
parents:
diff changeset
344 from_end,
a61af66fc99e Initial load
duke
parents:
diff changeset
345 pointer_delta(from_end, from_start, sizeof(char)));
a61af66fc99e Initial load
duke
parents:
diff changeset
346 gclog_or_tty->print_cr(" [ to_start .. to_end): "
a61af66fc99e Initial load
duke
parents:
diff changeset
347 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
a61af66fc99e Initial load
duke
parents:
diff changeset
348 to_start,
a61af66fc99e Initial load
duke
parents:
diff changeset
349 to_end,
a61af66fc99e Initial load
duke
parents:
diff changeset
350 pointer_delta( to_end, to_start, sizeof(char)));
a61af66fc99e Initial load
duke
parents:
diff changeset
351 }
a61af66fc99e Initial load
duke
parents:
diff changeset
352 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
353 // Eden, to, from
a61af66fc99e Initial load
duke
parents:
diff changeset
354 if (PrintAdaptiveSizePolicy && Verbose) {
a61af66fc99e Initial load
duke
parents:
diff changeset
355 gclog_or_tty->print_cr(" Eden, to, from:");
a61af66fc99e Initial load
duke
parents:
diff changeset
356 }
a61af66fc99e Initial load
duke
parents:
diff changeset
357
a61af66fc99e Initial load
duke
parents:
diff changeset
358 // To space gets priority over eden resizing. Note that we position
a61af66fc99e Initial load
duke
parents:
diff changeset
359 // to space as if we were able to resize from space, even though from
a61af66fc99e Initial load
duke
parents:
diff changeset
360 // space is not modified.
a61af66fc99e Initial load
duke
parents:
diff changeset
361 // Giving eden priority was tried and gave poorer performance.
a61af66fc99e Initial load
duke
parents:
diff changeset
362 to_end = (char*)pointer_delta(virtual_space()->high(),
a61af66fc99e Initial load
duke
parents:
diff changeset
363 (char*)requested_survivor_size,
a61af66fc99e Initial load
duke
parents:
diff changeset
364 sizeof(char));
a61af66fc99e Initial load
duke
parents:
diff changeset
365 to_end = MIN2(to_end, from_start);
a61af66fc99e Initial load
duke
parents:
diff changeset
366 to_start = (char*)pointer_delta(to_end, (char*)requested_survivor_size,
a61af66fc99e Initial load
duke
parents:
diff changeset
367 sizeof(char));
a61af66fc99e Initial load
duke
parents:
diff changeset
368 // if the space sizes are to be increased by several times then
a61af66fc99e Initial load
duke
parents:
diff changeset
369 // 'to_start' will point beyond the young generation. In this case
a61af66fc99e Initial load
duke
parents:
diff changeset
370 // 'to_start' should be adjusted.
a61af66fc99e Initial load
duke
parents:
diff changeset
371 to_start = MAX2(to_start, eden_start + alignment);
a61af66fc99e Initial load
duke
parents:
diff changeset
372
a61af66fc99e Initial load
duke
parents:
diff changeset
373 // Compute how big eden can be, then adjust end.
a61af66fc99e Initial load
duke
parents:
diff changeset
374 // See comment in PSYoungGen::resize_spaces() on
a61af66fc99e Initial load
duke
parents:
diff changeset
375 // calculating eden_end.
a61af66fc99e Initial load
duke
parents:
diff changeset
376 const size_t eden_size = MIN2(requested_eden_size,
a61af66fc99e Initial load
duke
parents:
diff changeset
377 pointer_delta(to_start,
a61af66fc99e Initial load
duke
parents:
diff changeset
378 eden_start,
a61af66fc99e Initial load
duke
parents:
diff changeset
379 sizeof(char)));
a61af66fc99e Initial load
duke
parents:
diff changeset
380 eden_end = eden_start + eden_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
381 assert(eden_end >= eden_start, "addition overflowed")
a61af66fc99e Initial load
duke
parents:
diff changeset
382
a61af66fc99e Initial load
duke
parents:
diff changeset
383 // Don't let eden shrink down to 0 or less.
a61af66fc99e Initial load
duke
parents:
diff changeset
384 eden_end = MAX2(eden_end, eden_start + alignment);
a61af66fc99e Initial load
duke
parents:
diff changeset
385 to_start = MAX2(to_start, eden_end);
a61af66fc99e Initial load
duke
parents:
diff changeset
386
a61af66fc99e Initial load
duke
parents:
diff changeset
387 if (PrintAdaptiveSizePolicy && Verbose) {
a61af66fc99e Initial load
duke
parents:
diff changeset
388 gclog_or_tty->print_cr(" [eden_start .. eden_end): "
a61af66fc99e Initial load
duke
parents:
diff changeset
389 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
a61af66fc99e Initial load
duke
parents:
diff changeset
390 eden_start,
a61af66fc99e Initial load
duke
parents:
diff changeset
391 eden_end,
a61af66fc99e Initial load
duke
parents:
diff changeset
392 pointer_delta(eden_end, eden_start, sizeof(char)));
a61af66fc99e Initial load
duke
parents:
diff changeset
393 gclog_or_tty->print_cr(" [ to_start .. to_end): "
a61af66fc99e Initial load
duke
parents:
diff changeset
394 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
a61af66fc99e Initial load
duke
parents:
diff changeset
395 to_start,
a61af66fc99e Initial load
duke
parents:
diff changeset
396 to_end,
a61af66fc99e Initial load
duke
parents:
diff changeset
397 pointer_delta( to_end, to_start, sizeof(char)));
a61af66fc99e Initial load
duke
parents:
diff changeset
398 gclog_or_tty->print_cr(" [from_start .. from_end): "
a61af66fc99e Initial load
duke
parents:
diff changeset
399 "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT,
a61af66fc99e Initial load
duke
parents:
diff changeset
400 from_start,
a61af66fc99e Initial load
duke
parents:
diff changeset
401 from_end,
a61af66fc99e Initial load
duke
parents:
diff changeset
402 pointer_delta(from_end, from_start, sizeof(char)));
a61af66fc99e Initial load
duke
parents:
diff changeset
403 }
a61af66fc99e Initial load
duke
parents:
diff changeset
404 }
a61af66fc99e Initial load
duke
parents:
diff changeset
405
a61af66fc99e Initial load
duke
parents:
diff changeset
406
a61af66fc99e Initial load
duke
parents:
diff changeset
407 guarantee((HeapWord*)from_start <= from_space()->bottom(),
a61af66fc99e Initial load
duke
parents:
diff changeset
408 "from start moved to the right");
a61af66fc99e Initial load
duke
parents:
diff changeset
409 guarantee((HeapWord*)from_end >= from_space()->top(),
a61af66fc99e Initial load
duke
parents:
diff changeset
410 "from end moved into live data");
a61af66fc99e Initial load
duke
parents:
diff changeset
411 assert(is_object_aligned((intptr_t)eden_start), "checking alignment");
a61af66fc99e Initial load
duke
parents:
diff changeset
412 assert(is_object_aligned((intptr_t)from_start), "checking alignment");
a61af66fc99e Initial load
duke
parents:
diff changeset
413 assert(is_object_aligned((intptr_t)to_start), "checking alignment");
a61af66fc99e Initial load
duke
parents:
diff changeset
414
a61af66fc99e Initial load
duke
parents:
diff changeset
415 MemRegion edenMR((HeapWord*)eden_start, (HeapWord*)eden_end);
a61af66fc99e Initial load
duke
parents:
diff changeset
416 MemRegion toMR ((HeapWord*)to_start, (HeapWord*)to_end);
a61af66fc99e Initial load
duke
parents:
diff changeset
417 MemRegion fromMR((HeapWord*)from_start, (HeapWord*)from_end);
a61af66fc99e Initial load
duke
parents:
diff changeset
418
a61af66fc99e Initial load
duke
parents:
diff changeset
419 // Let's make sure the call to initialize doesn't reset "top"!
a61af66fc99e Initial load
duke
parents:
diff changeset
420 DEBUG_ONLY(HeapWord* old_from_top = from_space()->top();)
a61af66fc99e Initial load
duke
parents:
diff changeset
421
a61af66fc99e Initial load
duke
parents:
diff changeset
422 // For PrintAdaptiveSizePolicy block below
a61af66fc99e Initial load
duke
parents:
diff changeset
423 size_t old_from = from_space()->capacity_in_bytes();
a61af66fc99e Initial load
duke
parents:
diff changeset
424 size_t old_to = to_space()->capacity_in_bytes();
a61af66fc99e Initial load
duke
parents:
diff changeset
425
a61af66fc99e Initial load
duke
parents:
diff changeset
426 eden_space()->initialize(edenMR, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
427 to_space()->initialize(toMR , true);
a61af66fc99e Initial load
duke
parents:
diff changeset
428 from_space()->initialize(fromMR, false); // Note, not cleared!
a61af66fc99e Initial load
duke
parents:
diff changeset
429 PSScavenge::set_young_generation_boundary(eden_space()->bottom());
a61af66fc99e Initial load
duke
parents:
diff changeset
430
a61af66fc99e Initial load
duke
parents:
diff changeset
431 assert(from_space()->top() == old_from_top, "from top changed!");
a61af66fc99e Initial load
duke
parents:
diff changeset
432
a61af66fc99e Initial load
duke
parents:
diff changeset
433 if (PrintAdaptiveSizePolicy) {
a61af66fc99e Initial load
duke
parents:
diff changeset
434 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
a61af66fc99e Initial load
duke
parents:
diff changeset
435 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
a61af66fc99e Initial load
duke
parents:
diff changeset
436
a61af66fc99e Initial load
duke
parents:
diff changeset
437 gclog_or_tty->print("AdaptiveSizePolicy::survivor space sizes: "
a61af66fc99e Initial load
duke
parents:
diff changeset
438 "collection: %d "
a61af66fc99e Initial load
duke
parents:
diff changeset
439 "(" SIZE_FORMAT ", " SIZE_FORMAT ") -> "
a61af66fc99e Initial load
duke
parents:
diff changeset
440 "(" SIZE_FORMAT ", " SIZE_FORMAT ") ",
a61af66fc99e Initial load
duke
parents:
diff changeset
441 heap->total_collections(),
a61af66fc99e Initial load
duke
parents:
diff changeset
442 old_from, old_to,
a61af66fc99e Initial load
duke
parents:
diff changeset
443 from_space()->capacity_in_bytes(),
a61af66fc99e Initial load
duke
parents:
diff changeset
444 to_space()->capacity_in_bytes());
a61af66fc99e Initial load
duke
parents:
diff changeset
445 gclog_or_tty->cr();
a61af66fc99e Initial load
duke
parents:
diff changeset
446 }
a61af66fc99e Initial load
duke
parents:
diff changeset
447 space_invariants();
a61af66fc99e Initial load
duke
parents:
diff changeset
448 }
a61af66fc99e Initial load
duke
parents:
diff changeset
449
a61af66fc99e Initial load
duke
parents:
diff changeset
450 void ASPSYoungGen::reset_after_change() {
a61af66fc99e Initial load
duke
parents:
diff changeset
451 assert_locked_or_safepoint(Heap_lock);
a61af66fc99e Initial load
duke
parents:
diff changeset
452
a61af66fc99e Initial load
duke
parents:
diff changeset
453 _reserved = MemRegion((HeapWord*)virtual_space()->low_boundary(),
a61af66fc99e Initial load
duke
parents:
diff changeset
454 (HeapWord*)virtual_space()->high_boundary());
a61af66fc99e Initial load
duke
parents:
diff changeset
455 PSScavenge::reference_processor()->set_span(_reserved);
a61af66fc99e Initial load
duke
parents:
diff changeset
456
a61af66fc99e Initial load
duke
parents:
diff changeset
457 HeapWord* new_eden_bottom = (HeapWord*)virtual_space()->low();
a61af66fc99e Initial load
duke
parents:
diff changeset
458 HeapWord* eden_bottom = eden_space()->bottom();
a61af66fc99e Initial load
duke
parents:
diff changeset
459 if (new_eden_bottom != eden_bottom) {
a61af66fc99e Initial load
duke
parents:
diff changeset
460 MemRegion eden_mr(new_eden_bottom, eden_space()->end());
a61af66fc99e Initial load
duke
parents:
diff changeset
461 eden_space()->initialize(eden_mr, true);
a61af66fc99e Initial load
duke
parents:
diff changeset
462 PSScavenge::set_young_generation_boundary(eden_space()->bottom());
a61af66fc99e Initial load
duke
parents:
diff changeset
463 }
a61af66fc99e Initial load
duke
parents:
diff changeset
464 MemRegion cmr((HeapWord*)virtual_space()->low(),
a61af66fc99e Initial load
duke
parents:
diff changeset
465 (HeapWord*)virtual_space()->high());
a61af66fc99e Initial load
duke
parents:
diff changeset
466 Universe::heap()->barrier_set()->resize_covered_region(cmr);
a61af66fc99e Initial load
duke
parents:
diff changeset
467
a61af66fc99e Initial load
duke
parents:
diff changeset
468 space_invariants();
a61af66fc99e Initial load
duke
parents:
diff changeset
469 }