Mercurial > hg > graal-jvmci-8
annotate src/share/vm/memory/generation.cpp @ 22298:c28cb37b2e1d
Rename JVMCI to INCLUDE_JVMCI.
author | twisti |
---|---|
date | Wed, 22 Jul 2015 08:56:03 -0700 |
parents | 30c99d8e0f02 |
children |
rev | line source |
---|---|
0 | 1 /* |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
13400
diff
changeset
|
2 * Copyright (c) 1997, 2014, 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:
1051
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1051
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:
1051
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #include "precompiled.hpp" |
10405 | 26 #include "gc_implementation/shared/gcTimer.hpp" |
27 #include "gc_implementation/shared/gcTrace.hpp" | |
1972 | 28 #include "gc_implementation/shared/spaceDecorator.hpp" |
29 #include "gc_interface/collectedHeap.inline.hpp" | |
30 #include "memory/allocation.inline.hpp" | |
31 #include "memory/blockOffsetTable.inline.hpp" | |
32 #include "memory/cardTableRS.hpp" | |
33 #include "memory/gcLocker.inline.hpp" | |
34 #include "memory/genCollectedHeap.hpp" | |
35 #include "memory/genMarkSweep.hpp" | |
36 #include "memory/genOopClosures.hpp" | |
37 #include "memory/genOopClosures.inline.hpp" | |
38 #include "memory/generation.hpp" | |
39 #include "memory/generation.inline.hpp" | |
40 #include "memory/space.inline.hpp" | |
41 #include "oops/oop.inline.hpp" | |
42 #include "runtime/java.hpp" | |
43 #include "utilities/copy.hpp" | |
44 #include "utilities/events.hpp" | |
0 | 45 |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
13400
diff
changeset
|
46 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC |
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
13400
diff
changeset
|
47 |
0 | 48 Generation::Generation(ReservedSpace rs, size_t initial_size, int level) : |
49 _level(level), | |
50 _ref_processor(NULL) { | |
51 if (!_virtual_space.initialize(rs, initial_size)) { | |
52 vm_exit_during_initialization("Could not reserve enough space for " | |
53 "object heap"); | |
54 } | |
263
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
55 // Mangle all of the the initial generation. |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
56 if (ZapUnusedHeapArea) { |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
57 MemRegion mangle_region((HeapWord*)_virtual_space.low(), |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
58 (HeapWord*)_virtual_space.high()); |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
59 SpaceMangler::mangle_region(mangle_region); |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
60 } |
0 | 61 _reserved = MemRegion((HeapWord*)_virtual_space.low_boundary(), |
62 (HeapWord*)_virtual_space.high_boundary()); | |
63 } | |
64 | |
65 GenerationSpec* Generation::spec() { | |
66 GenCollectedHeap* gch = GenCollectedHeap::heap(); | |
67 assert(0 <= level() && level() < gch->_n_gens, "Bad gen level"); | |
68 return gch->_gen_specs[level()]; | |
69 } | |
70 | |
71 size_t Generation::max_capacity() const { | |
72 return reserved().byte_size(); | |
73 } | |
74 | |
75 void Generation::print_heap_change(size_t prev_used) const { | |
76 if (PrintGCDetails && Verbose) { | |
77 gclog_or_tty->print(" " SIZE_FORMAT | |
78 "->" SIZE_FORMAT | |
79 "(" SIZE_FORMAT ")", | |
80 prev_used, used(), capacity()); | |
81 } else { | |
82 gclog_or_tty->print(" " SIZE_FORMAT "K" | |
83 "->" SIZE_FORMAT "K" | |
84 "(" SIZE_FORMAT "K)", | |
85 prev_used / K, used() / K, capacity() / K); | |
86 } | |
87 } | |
88 | |
89 // By default we get a single threaded default reference processor; | |
2369
92da084fefc9
6668573: CMS: reference processing crash if ParallelCMSThreads > ParallelGCThreads
ysr
parents:
1972
diff
changeset
|
90 // generations needing multi-threaded refs processing or discovery override this method. |
0 | 91 void Generation::ref_processor_init() { |
92 assert(_ref_processor == NULL, "a reference processor already exists"); | |
93 assert(!_reserved.is_empty(), "empty generation?"); | |
2369
92da084fefc9
6668573: CMS: reference processing crash if ParallelCMSThreads > ParallelGCThreads
ysr
parents:
1972
diff
changeset
|
94 _ref_processor = new ReferenceProcessor(_reserved); // a vanilla reference processor |
0 | 95 if (_ref_processor == NULL) { |
96 vm_exit_during_initialization("Could not allocate ReferenceProcessor object"); | |
97 } | |
98 } | |
99 | |
100 void Generation::print() const { print_on(tty); } | |
101 | |
102 void Generation::print_on(outputStream* st) const { | |
103 st->print(" %-20s", name()); | |
104 st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", | |
105 capacity()/K, used()/K); | |
106 st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", | |
107 _virtual_space.low_boundary(), | |
108 _virtual_space.high(), | |
109 _virtual_space.high_boundary()); | |
110 } | |
111 | |
112 void Generation::print_summary_info() { print_summary_info_on(tty); } | |
113 | |
114 void Generation::print_summary_info_on(outputStream* st) { | |
115 StatRecord* sr = stat_record(); | |
116 double time = sr->accumulated_time.seconds(); | |
117 st->print_cr("[Accumulated GC generation %d time %3.7f secs, " | |
118 "%d GC's, avg GC time %3.7f]", | |
119 level(), time, sr->invocations, | |
120 sr->invocations > 0 ? time / sr->invocations : 0.0); | |
121 } | |
122 | |
123 // Utility iterator classes | |
124 | |
125 class GenerationIsInReservedClosure : public SpaceClosure { | |
126 public: | |
127 const void* _p; | |
128 Space* sp; | |
129 virtual void do_space(Space* s) { | |
130 if (sp == NULL) { | |
131 if (s->is_in_reserved(_p)) sp = s; | |
132 } | |
133 } | |
134 GenerationIsInReservedClosure(const void* p) : _p(p), sp(NULL) {} | |
135 }; | |
136 | |
137 class GenerationIsInClosure : public SpaceClosure { | |
138 public: | |
139 const void* _p; | |
140 Space* sp; | |
141 virtual void do_space(Space* s) { | |
142 if (sp == NULL) { | |
143 if (s->is_in(_p)) sp = s; | |
144 } | |
145 } | |
146 GenerationIsInClosure(const void* p) : _p(p), sp(NULL) {} | |
147 }; | |
148 | |
149 bool Generation::is_in(const void* p) const { | |
150 GenerationIsInClosure blk(p); | |
151 ((Generation*)this)->space_iterate(&blk); | |
152 return blk.sp != NULL; | |
153 } | |
154 | |
155 DefNewGeneration* Generation::as_DefNewGeneration() { | |
156 assert((kind() == Generation::DefNew) || | |
157 (kind() == Generation::ParNew) || | |
158 (kind() == Generation::ASParNew), | |
159 "Wrong youngest generation type"); | |
160 return (DefNewGeneration*) this; | |
161 } | |
162 | |
163 Generation* Generation::next_gen() const { | |
164 GenCollectedHeap* gch = GenCollectedHeap::heap(); | |
165 int next = level() + 1; | |
166 if (next < gch->_n_gens) { | |
167 return gch->_gens[next]; | |
168 } else { | |
169 return NULL; | |
170 } | |
171 } | |
172 | |
173 size_t Generation::max_contiguous_available() const { | |
174 // The largest number of contiguous free words in this or any higher generation. | |
175 size_t max = 0; | |
176 for (const Generation* gen = this; gen != NULL; gen = gen->next_gen()) { | |
177 size_t avail = gen->contiguous_available(); | |
178 if (avail > max) { | |
179 max = avail; | |
180 } | |
181 } | |
182 return max; | |
183 } | |
184 | |
1888
a7214d79fcf1
6896603: CMS/GCH: collection_attempt_is_safe() ergo should use more recent data
ysr
parents:
1552
diff
changeset
|
185 bool Generation::promotion_attempt_is_safe(size_t max_promotion_in_bytes) const { |
a7214d79fcf1
6896603: CMS/GCH: collection_attempt_is_safe() ergo should use more recent data
ysr
parents:
1552
diff
changeset
|
186 size_t available = max_contiguous_available(); |
a7214d79fcf1
6896603: CMS/GCH: collection_attempt_is_safe() ergo should use more recent data
ysr
parents:
1552
diff
changeset
|
187 bool res = (available >= max_promotion_in_bytes); |
0 | 188 if (PrintGC && Verbose) { |
1888
a7214d79fcf1
6896603: CMS/GCH: collection_attempt_is_safe() ergo should use more recent data
ysr
parents:
1552
diff
changeset
|
189 gclog_or_tty->print_cr( |
a7214d79fcf1
6896603: CMS/GCH: collection_attempt_is_safe() ergo should use more recent data
ysr
parents:
1552
diff
changeset
|
190 "Generation: promo attempt is%s safe: available("SIZE_FORMAT") %s max_promo("SIZE_FORMAT")", |
a7214d79fcf1
6896603: CMS/GCH: collection_attempt_is_safe() ergo should use more recent data
ysr
parents:
1552
diff
changeset
|
191 res? "":" not", available, res? ">=":"<", |
a7214d79fcf1
6896603: CMS/GCH: collection_attempt_is_safe() ergo should use more recent data
ysr
parents:
1552
diff
changeset
|
192 max_promotion_in_bytes); |
0 | 193 } |
1888
a7214d79fcf1
6896603: CMS/GCH: collection_attempt_is_safe() ergo should use more recent data
ysr
parents:
1552
diff
changeset
|
194 return res; |
0 | 195 } |
196 | |
197 // Ignores "ref" and calls allocate(). | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
198 oop Generation::promote(oop obj, size_t obj_size) { |
0 | 199 assert(obj_size == (size_t)obj->size(), "bad obj_size passed in"); |
200 | |
201 #ifndef PRODUCT | |
202 if (Universe::heap()->promotion_should_fail()) { | |
203 return NULL; | |
204 } | |
205 #endif // #ifndef PRODUCT | |
206 | |
207 HeapWord* result = allocate(obj_size, false); | |
208 if (result != NULL) { | |
209 Copy::aligned_disjoint_words((HeapWord*)obj, result, obj_size); | |
210 return oop(result); | |
211 } else { | |
212 GenCollectedHeap* gch = GenCollectedHeap::heap(); | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
0
diff
changeset
|
213 return gch->handle_failed_promotion(this, obj, obj_size); |
0 | 214 } |
215 } | |
216 | |
217 oop Generation::par_promote(int thread_num, | |
218 oop obj, markOop m, size_t word_sz) { | |
219 // Could do a bad general impl here that gets a lock. But no. | |
220 ShouldNotCallThis(); | |
221 return NULL; | |
222 } | |
223 | |
224 void Generation::par_promote_alloc_undo(int thread_num, | |
225 HeapWord* obj, size_t word_sz) { | |
226 // Could do a bad general impl here that gets a lock. But no. | |
227 guarantee(false, "No good general implementation."); | |
228 } | |
229 | |
230 Space* Generation::space_containing(const void* p) const { | |
231 GenerationIsInReservedClosure blk(p); | |
232 // Cast away const | |
233 ((Generation*)this)->space_iterate(&blk); | |
234 return blk.sp; | |
235 } | |
236 | |
237 // Some of these are mediocre general implementations. Should be | |
238 // overridden to get better performance. | |
239 | |
240 class GenerationBlockStartClosure : public SpaceClosure { | |
241 public: | |
242 const void* _p; | |
243 HeapWord* _start; | |
244 virtual void do_space(Space* s) { | |
245 if (_start == NULL && s->is_in_reserved(_p)) { | |
246 _start = s->block_start(_p); | |
247 } | |
248 } | |
249 GenerationBlockStartClosure(const void* p) { _p = p; _start = NULL; } | |
250 }; | |
251 | |
252 HeapWord* Generation::block_start(const void* p) const { | |
253 GenerationBlockStartClosure blk(p); | |
254 // Cast away const | |
255 ((Generation*)this)->space_iterate(&blk); | |
256 return blk._start; | |
257 } | |
258 | |
259 class GenerationBlockSizeClosure : public SpaceClosure { | |
260 public: | |
261 const HeapWord* _p; | |
262 size_t size; | |
263 virtual void do_space(Space* s) { | |
264 if (size == 0 && s->is_in_reserved(_p)) { | |
265 size = s->block_size(_p); | |
266 } | |
267 } | |
268 GenerationBlockSizeClosure(const HeapWord* p) { _p = p; size = 0; } | |
269 }; | |
270 | |
271 size_t Generation::block_size(const HeapWord* p) const { | |
272 GenerationBlockSizeClosure blk(p); | |
273 // Cast away const | |
274 ((Generation*)this)->space_iterate(&blk); | |
275 assert(blk.size > 0, "seems reasonable"); | |
276 return blk.size; | |
277 } | |
278 | |
279 class GenerationBlockIsObjClosure : public SpaceClosure { | |
280 public: | |
281 const HeapWord* _p; | |
282 bool is_obj; | |
283 virtual void do_space(Space* s) { | |
284 if (!is_obj && s->is_in_reserved(_p)) { | |
285 is_obj |= s->block_is_obj(_p); | |
286 } | |
287 } | |
288 GenerationBlockIsObjClosure(const HeapWord* p) { _p = p; is_obj = false; } | |
289 }; | |
290 | |
291 bool Generation::block_is_obj(const HeapWord* p) const { | |
292 GenerationBlockIsObjClosure blk(p); | |
293 // Cast away const | |
294 ((Generation*)this)->space_iterate(&blk); | |
295 return blk.is_obj; | |
296 } | |
297 | |
298 class GenerationOopIterateClosure : public SpaceClosure { | |
299 public: | |
20264
30c99d8e0f02
8038399: Remove dead oop_iterate MemRegion variants from SharedHeap, Generation and Space classes
mgerdin
parents:
17937
diff
changeset
|
300 ExtendedOopClosure* _cl; |
0 | 301 virtual void do_space(Space* s) { |
20264
30c99d8e0f02
8038399: Remove dead oop_iterate MemRegion variants from SharedHeap, Generation and Space classes
mgerdin
parents:
17937
diff
changeset
|
302 s->oop_iterate(_cl); |
0 | 303 } |
20264
30c99d8e0f02
8038399: Remove dead oop_iterate MemRegion variants from SharedHeap, Generation and Space classes
mgerdin
parents:
17937
diff
changeset
|
304 GenerationOopIterateClosure(ExtendedOopClosure* cl) : |
30c99d8e0f02
8038399: Remove dead oop_iterate MemRegion variants from SharedHeap, Generation and Space classes
mgerdin
parents:
17937
diff
changeset
|
305 _cl(cl) {} |
0 | 306 }; |
307 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
308 void Generation::oop_iterate(ExtendedOopClosure* cl) { |
20264
30c99d8e0f02
8038399: Remove dead oop_iterate MemRegion variants from SharedHeap, Generation and Space classes
mgerdin
parents:
17937
diff
changeset
|
309 GenerationOopIterateClosure blk(cl); |
0 | 310 space_iterate(&blk); |
311 } | |
312 | |
313 void Generation::younger_refs_in_space_iterate(Space* sp, | |
314 OopsInGenClosure* cl) { | |
315 GenRemSet* rs = SharedHeap::heap()->rem_set(); | |
316 rs->younger_refs_in_space_iterate(sp, cl); | |
317 } | |
318 | |
319 class GenerationObjIterateClosure : public SpaceClosure { | |
320 private: | |
321 ObjectClosure* _cl; | |
322 public: | |
323 virtual void do_space(Space* s) { | |
324 s->object_iterate(_cl); | |
325 } | |
326 GenerationObjIterateClosure(ObjectClosure* cl) : _cl(cl) {} | |
327 }; | |
328 | |
329 void Generation::object_iterate(ObjectClosure* cl) { | |
330 GenerationObjIterateClosure blk(cl); | |
331 space_iterate(&blk); | |
332 } | |
333 | |
517
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
334 class GenerationSafeObjIterateClosure : public SpaceClosure { |
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
335 private: |
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
336 ObjectClosure* _cl; |
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
337 public: |
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
338 virtual void do_space(Space* s) { |
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
339 s->safe_object_iterate(_cl); |
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
340 } |
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
341 GenerationSafeObjIterateClosure(ObjectClosure* cl) : _cl(cl) {} |
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
342 }; |
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
343 |
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
344 void Generation::safe_object_iterate(ObjectClosure* cl) { |
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
345 GenerationSafeObjIterateClosure blk(cl); |
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
346 space_iterate(&blk); |
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
347 } |
e9be0e04635a
6689653: JMapPerm fails with UseConcMarkSweepIncGC and compressed oops off
jmasa
parents:
271
diff
changeset
|
348 |
0 | 349 void Generation::prepare_for_compaction(CompactPoint* cp) { |
350 // Generic implementation, can be specialized | |
351 CompactibleSpace* space = first_compaction_space(); | |
352 while (space != NULL) { | |
353 space->prepare_for_compaction(cp); | |
354 space = space->next_compaction_space(); | |
355 } | |
356 } | |
357 | |
358 class AdjustPointersClosure: public SpaceClosure { | |
359 public: | |
360 void do_space(Space* sp) { | |
361 sp->adjust_pointers(); | |
362 } | |
363 }; | |
364 | |
365 void Generation::adjust_pointers() { | |
366 // Note that this is done over all spaces, not just the compactible | |
367 // ones. | |
368 AdjustPointersClosure blk; | |
369 space_iterate(&blk, true); | |
370 } | |
371 | |
372 void Generation::compact() { | |
373 CompactibleSpace* sp = first_compaction_space(); | |
374 while (sp != NULL) { | |
375 sp->compact(); | |
376 sp = sp->next_compaction_space(); | |
377 } | |
378 } | |
379 | |
380 CardGeneration::CardGeneration(ReservedSpace rs, size_t initial_byte_size, | |
381 int level, | |
382 GenRemSet* remset) : | |
9072
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
383 Generation(rs, initial_byte_size, level), _rs(remset), |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
384 _shrink_factor(0), _min_heap_delta_bytes(), _capacity_at_prologue(), |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
385 _used_at_prologue() |
0 | 386 { |
387 HeapWord* start = (HeapWord*)rs.base(); | |
388 size_t reserved_byte_size = rs.size(); | |
389 assert((uintptr_t(start) & 3) == 0, "bad alignment"); | |
390 assert((reserved_byte_size & 3) == 0, "bad alignment"); | |
391 MemRegion reserved_mr(start, heap_word_size(reserved_byte_size)); | |
392 _bts = new BlockOffsetSharedArray(reserved_mr, | |
393 heap_word_size(initial_byte_size)); | |
394 MemRegion committed_mr(start, heap_word_size(initial_byte_size)); | |
395 _rs->resize_covered_region(committed_mr); | |
396 if (_bts == NULL) | |
397 vm_exit_during_initialization("Could not allocate a BlockOffsetArray"); | |
398 | |
399 // Verify that the start and end of this generation is the start of a card. | |
400 // If this wasn't true, a single card could span more than on generation, | |
401 // which would cause problems when we commit/uncommit memory, and when we | |
402 // clear and dirty cards. | |
403 guarantee(_rs->is_aligned(reserved_mr.start()), "generation must be card aligned"); | |
404 if (reserved_mr.end() != Universe::heap()->reserved_region().end()) { | |
405 // Don't check at the very end of the heap as we'll assert that we're probing off | |
406 // the end if we try. | |
407 guarantee(_rs->is_aligned(reserved_mr.end()), "generation must be card aligned"); | |
408 } | |
9072
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
409 _min_heap_delta_bytes = MinHeapDeltaBytes; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
410 _capacity_at_prologue = initial_byte_size; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
411 _used_at_prologue = 0; |
0 | 412 } |
413 | |
271
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
414 bool CardGeneration::expand(size_t bytes, size_t expand_bytes) { |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
415 assert_locked_or_safepoint(Heap_lock); |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
416 if (bytes == 0) { |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
417 return true; // That's what grow_by(0) would return |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
418 } |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
419 size_t aligned_bytes = ReservedSpace::page_align_size_up(bytes); |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
420 if (aligned_bytes == 0){ |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
421 // The alignment caused the number of bytes to wrap. An expand_by(0) will |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
422 // return true with the implication that an expansion was done when it |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
423 // was not. A call to expand implies a best effort to expand by "bytes" |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
424 // but not a guarantee. Align down to give a best effort. This is likely |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
425 // the most that the generation can expand since it has some capacity to |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
426 // start with. |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
427 aligned_bytes = ReservedSpace::page_align_size_down(bytes); |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
428 } |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
429 size_t aligned_expand_bytes = ReservedSpace::page_align_size_up(expand_bytes); |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
430 bool success = false; |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
431 if (aligned_expand_bytes > aligned_bytes) { |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
432 success = grow_by(aligned_expand_bytes); |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
433 } |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
434 if (!success) { |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
435 success = grow_by(aligned_bytes); |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
436 } |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
437 if (!success) { |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
438 success = grow_to_reserved(); |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
439 } |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
440 if (PrintGC && Verbose) { |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6008
diff
changeset
|
441 if (success && GC_locker::is_active_and_needs_gc()) { |
271
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
442 gclog_or_tty->print_cr("Garbage collection disabled, expanded heap instead"); |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
443 } |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
444 } |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
445 |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
446 return success; |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
447 } |
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
448 |
0 | 449 |
450 // No young generation references, clear this generation's cards. | |
451 void CardGeneration::clear_remembered_set() { | |
452 _rs->clear(reserved()); | |
453 } | |
454 | |
455 | |
456 // Objects in this generation may have moved, invalidate this | |
457 // generation's cards. | |
458 void CardGeneration::invalidate_remembered_set() { | |
459 _rs->invalidate(used_region()); | |
460 } | |
461 | |
462 | |
9072
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
463 void CardGeneration::compute_new_size() { |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
464 assert(_shrink_factor <= 100, "invalid shrink factor"); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
465 size_t current_shrink_factor = _shrink_factor; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
466 _shrink_factor = 0; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
467 |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
468 // We don't have floating point command-line arguments |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
469 // Note: argument processing ensures that MinHeapFreeRatio < 100. |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
470 const double minimum_free_percentage = MinHeapFreeRatio / 100.0; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
471 const double maximum_used_percentage = 1.0 - minimum_free_percentage; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
472 |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
473 // Compute some numbers about the state of the heap. |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
474 const size_t used_after_gc = used(); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
475 const size_t capacity_after_gc = capacity(); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
476 |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
477 const double min_tmp = used_after_gc / maximum_used_percentage; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
478 size_t minimum_desired_capacity = (size_t)MIN2(min_tmp, double(max_uintx)); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
479 // Don't shrink less than the initial generation size |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
480 minimum_desired_capacity = MAX2(minimum_desired_capacity, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
481 spec()->init_size()); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
482 assert(used_after_gc <= minimum_desired_capacity, "sanity check"); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
483 |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
484 if (PrintGC && Verbose) { |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
485 const size_t free_after_gc = free(); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
486 const double free_percentage = ((double)free_after_gc) / capacity_after_gc; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
487 gclog_or_tty->print_cr("TenuredGeneration::compute_new_size: "); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
488 gclog_or_tty->print_cr(" " |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
489 " minimum_free_percentage: %6.2f" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
490 " maximum_used_percentage: %6.2f", |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
491 minimum_free_percentage, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
492 maximum_used_percentage); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
493 gclog_or_tty->print_cr(" " |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
494 " free_after_gc : %6.1fK" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
495 " used_after_gc : %6.1fK" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
496 " capacity_after_gc : %6.1fK", |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
497 free_after_gc / (double) K, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
498 used_after_gc / (double) K, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
499 capacity_after_gc / (double) K); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
500 gclog_or_tty->print_cr(" " |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
501 " free_percentage: %6.2f", |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
502 free_percentage); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
503 } |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
504 |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
505 if (capacity_after_gc < minimum_desired_capacity) { |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
506 // If we have less free space than we want then expand |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
507 size_t expand_bytes = minimum_desired_capacity - capacity_after_gc; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
508 // Don't expand unless it's significant |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
509 if (expand_bytes >= _min_heap_delta_bytes) { |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
510 expand(expand_bytes, 0); // safe if expansion fails |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
511 } |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
512 if (PrintGC && Verbose) { |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
513 gclog_or_tty->print_cr(" expanding:" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
514 " minimum_desired_capacity: %6.1fK" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
515 " expand_bytes: %6.1fK" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
516 " _min_heap_delta_bytes: %6.1fK", |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
517 minimum_desired_capacity / (double) K, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
518 expand_bytes / (double) K, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
519 _min_heap_delta_bytes / (double) K); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
520 } |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
521 return; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
522 } |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
523 |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
524 // No expansion, now see if we want to shrink |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
525 size_t shrink_bytes = 0; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
526 // We would never want to shrink more than this |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
527 size_t max_shrink_bytes = capacity_after_gc - minimum_desired_capacity; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
528 |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
529 if (MaxHeapFreeRatio < 100) { |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
530 const double maximum_free_percentage = MaxHeapFreeRatio / 100.0; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
531 const double minimum_used_percentage = 1.0 - maximum_free_percentage; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
532 const double max_tmp = used_after_gc / minimum_used_percentage; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
533 size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(max_uintx)); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
534 maximum_desired_capacity = MAX2(maximum_desired_capacity, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
535 spec()->init_size()); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
536 if (PrintGC && Verbose) { |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
537 gclog_or_tty->print_cr(" " |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
538 " maximum_free_percentage: %6.2f" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
539 " minimum_used_percentage: %6.2f", |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
540 maximum_free_percentage, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
541 minimum_used_percentage); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
542 gclog_or_tty->print_cr(" " |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
543 " _capacity_at_prologue: %6.1fK" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
544 " minimum_desired_capacity: %6.1fK" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
545 " maximum_desired_capacity: %6.1fK", |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
546 _capacity_at_prologue / (double) K, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
547 minimum_desired_capacity / (double) K, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
548 maximum_desired_capacity / (double) K); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
549 } |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
550 assert(minimum_desired_capacity <= maximum_desired_capacity, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
551 "sanity check"); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
552 |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
553 if (capacity_after_gc > maximum_desired_capacity) { |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
554 // Capacity too large, compute shrinking size |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
555 shrink_bytes = capacity_after_gc - maximum_desired_capacity; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
556 // We don't want shrink all the way back to initSize if people call |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
557 // System.gc(), because some programs do that between "phases" and then |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
558 // we'd just have to grow the heap up again for the next phase. So we |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
559 // damp the shrinking: 0% on the first call, 10% on the second call, 40% |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
560 // on the third call, and 100% by the fourth call. But if we recompute |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
561 // size without shrinking, it goes back to 0%. |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
562 shrink_bytes = shrink_bytes / 100 * current_shrink_factor; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
563 assert(shrink_bytes <= max_shrink_bytes, "invalid shrink size"); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
564 if (current_shrink_factor == 0) { |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
565 _shrink_factor = 10; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
566 } else { |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
567 _shrink_factor = MIN2(current_shrink_factor * 4, (size_t) 100); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
568 } |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
569 if (PrintGC && Verbose) { |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
570 gclog_or_tty->print_cr(" " |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
571 " shrinking:" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
572 " initSize: %.1fK" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
573 " maximum_desired_capacity: %.1fK", |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
574 spec()->init_size() / (double) K, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
575 maximum_desired_capacity / (double) K); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
576 gclog_or_tty->print_cr(" " |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
577 " shrink_bytes: %.1fK" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
578 " current_shrink_factor: %d" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
579 " new shrink factor: %d" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
580 " _min_heap_delta_bytes: %.1fK", |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
581 shrink_bytes / (double) K, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
582 current_shrink_factor, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
583 _shrink_factor, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
584 _min_heap_delta_bytes / (double) K); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
585 } |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
586 } |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
587 } |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
588 |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
589 if (capacity_after_gc > _capacity_at_prologue) { |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
590 // We might have expanded for promotions, in which case we might want to |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
591 // take back that expansion if there's room after GC. That keeps us from |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
592 // stretching the heap with promotions when there's plenty of room. |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
593 size_t expansion_for_promotion = capacity_after_gc - _capacity_at_prologue; |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
594 expansion_for_promotion = MIN2(expansion_for_promotion, max_shrink_bytes); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
595 // We have two shrinking computations, take the largest |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
596 shrink_bytes = MAX2(shrink_bytes, expansion_for_promotion); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
597 assert(shrink_bytes <= max_shrink_bytes, "invalid shrink size"); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
598 if (PrintGC && Verbose) { |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
599 gclog_or_tty->print_cr(" " |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
600 " aggressive shrinking:" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
601 " _capacity_at_prologue: %.1fK" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
602 " capacity_after_gc: %.1fK" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
603 " expansion_for_promotion: %.1fK" |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
604 " shrink_bytes: %.1fK", |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
605 capacity_after_gc / (double) K, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
606 _capacity_at_prologue / (double) K, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
607 expansion_for_promotion / (double) K, |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
608 shrink_bytes / (double) K); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
609 } |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
610 } |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
611 // Don't shrink unless it's significant |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
612 if (shrink_bytes >= _min_heap_delta_bytes) { |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
613 shrink(shrink_bytes); |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
614 } |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
615 } |
8617e38bb4cb
8008508: CMS does not correctly reduce heap size after a Full GC
jmasa
parents:
6725
diff
changeset
|
616 |
0 | 617 // Currently nothing to do. |
618 void CardGeneration::prepare_for_verify() {} | |
619 | |
620 | |
621 void OneContigSpaceCardGeneration::collect(bool full, | |
622 bool clear_all_soft_refs, | |
623 size_t size, | |
624 bool is_tlab) { | |
10405 | 625 GenCollectedHeap* gch = GenCollectedHeap::heap(); |
626 | |
0 | 627 SpecializationStats::clear(); |
628 // Temporarily expand the span of our ref processor, so | |
629 // refs discovery is over the entire heap, not just this generation | |
630 ReferenceProcessorSpanMutator | |
10405 | 631 x(ref_processor(), gch->reserved_region()); |
632 | |
633 STWGCTimer* gc_timer = GenMarkSweep::gc_timer(); | |
13400
86e6d691f2e1
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
11096
diff
changeset
|
634 gc_timer->register_gc_start(); |
10405 | 635 |
636 SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer(); | |
637 gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start()); | |
638 | |
0 | 639 GenMarkSweep::invoke_at_safepoint(_level, ref_processor(), clear_all_soft_refs); |
10405 | 640 |
13400
86e6d691f2e1
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
11096
diff
changeset
|
641 gc_timer->register_gc_end(); |
10405 | 642 |
13400
86e6d691f2e1
8028128: Add a type safe alternative for working with counter based data
mgronlun
parents:
11096
diff
changeset
|
643 gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions()); |
10405 | 644 |
0 | 645 SpecializationStats::print(); |
646 } | |
647 | |
648 HeapWord* | |
649 OneContigSpaceCardGeneration::expand_and_allocate(size_t word_size, | |
650 bool is_tlab, | |
651 bool parallel) { | |
652 assert(!is_tlab, "OneContigSpaceCardGeneration does not support TLAB allocation"); | |
653 if (parallel) { | |
654 MutexLocker x(ParGCRareEvent_lock); | |
655 HeapWord* result = NULL; | |
656 size_t byte_size = word_size * HeapWordSize; | |
657 while (true) { | |
658 expand(byte_size, _min_heap_delta_bytes); | |
659 if (GCExpandToAllocateDelayMillis > 0) { | |
660 os::sleep(Thread::current(), GCExpandToAllocateDelayMillis, false); | |
661 } | |
662 result = _the_space->par_allocate(word_size); | |
663 if ( result != NULL) { | |
664 return result; | |
665 } else { | |
666 // If there's not enough expansion space available, give up. | |
667 if (_virtual_space.uncommitted_size() < byte_size) { | |
668 return NULL; | |
669 } | |
670 // else try again | |
671 } | |
672 } | |
673 } else { | |
674 expand(word_size*HeapWordSize, _min_heap_delta_bytes); | |
675 return _the_space->allocate(word_size); | |
676 } | |
677 } | |
678 | |
271
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
679 bool OneContigSpaceCardGeneration::expand(size_t bytes, size_t expand_bytes) { |
0 | 680 GCMutexLocker x(ExpandHeap_lock); |
271
818a18cd69a8
6730514: assertion failure in mangling code when expanding by 0 bytes
jmasa
parents:
269
diff
changeset
|
681 return CardGeneration::expand(bytes, expand_bytes); |
0 | 682 } |
683 | |
684 | |
685 void OneContigSpaceCardGeneration::shrink(size_t bytes) { | |
686 assert_locked_or_safepoint(ExpandHeap_lock); | |
687 size_t size = ReservedSpace::page_align_size_down(bytes); | |
688 if (size > 0) { | |
689 shrink_by(size); | |
690 } | |
691 } | |
692 | |
693 | |
694 size_t OneContigSpaceCardGeneration::capacity() const { | |
695 return _the_space->capacity(); | |
696 } | |
697 | |
698 | |
699 size_t OneContigSpaceCardGeneration::used() const { | |
700 return _the_space->used(); | |
701 } | |
702 | |
703 | |
704 size_t OneContigSpaceCardGeneration::free() const { | |
705 return _the_space->free(); | |
706 } | |
707 | |
708 MemRegion OneContigSpaceCardGeneration::used_region() const { | |
709 return the_space()->used_region(); | |
710 } | |
711 | |
712 size_t OneContigSpaceCardGeneration::unsafe_max_alloc_nogc() const { | |
713 return _the_space->free(); | |
714 } | |
715 | |
716 size_t OneContigSpaceCardGeneration::contiguous_available() const { | |
717 return _the_space->free() + _virtual_space.uncommitted_size(); | |
718 } | |
719 | |
720 bool OneContigSpaceCardGeneration::grow_by(size_t bytes) { | |
721 assert_locked_or_safepoint(ExpandHeap_lock); | |
722 bool result = _virtual_space.expand_by(bytes); | |
723 if (result) { | |
724 size_t new_word_size = | |
725 heap_word_size(_virtual_space.committed_size()); | |
726 MemRegion mr(_the_space->bottom(), new_word_size); | |
727 // Expand card table | |
728 Universe::heap()->barrier_set()->resize_covered_region(mr); | |
729 // Expand shared block offset array | |
730 _bts->resize(new_word_size); | |
731 | |
732 // Fix for bug #4668531 | |
263
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
733 if (ZapUnusedHeapArea) { |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
734 MemRegion mangle_region(_the_space->end(), |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
735 (HeapWord*)_virtual_space.high()); |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
736 SpaceMangler::mangle_region(mangle_region); |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
737 } |
0 | 738 |
739 // Expand space -- also expands space's BOT | |
740 // (which uses (part of) shared array above) | |
741 _the_space->set_end((HeapWord*)_virtual_space.high()); | |
742 | |
743 // update the space and generation capacity counters | |
744 update_counters(); | |
745 | |
746 if (Verbose && PrintGC) { | |
747 size_t new_mem_size = _virtual_space.committed_size(); | |
748 size_t old_mem_size = new_mem_size - bytes; | |
749 gclog_or_tty->print_cr("Expanding %s from " SIZE_FORMAT "K by " | |
750 SIZE_FORMAT "K to " SIZE_FORMAT "K", | |
751 name(), old_mem_size/K, bytes/K, new_mem_size/K); | |
752 } | |
753 } | |
754 return result; | |
755 } | |
756 | |
757 | |
758 bool OneContigSpaceCardGeneration::grow_to_reserved() { | |
759 assert_locked_or_safepoint(ExpandHeap_lock); | |
760 bool success = true; | |
761 const size_t remaining_bytes = _virtual_space.uncommitted_size(); | |
762 if (remaining_bytes > 0) { | |
763 success = grow_by(remaining_bytes); | |
764 DEBUG_ONLY(if (!success) warning("grow to reserved failed");) | |
765 } | |
766 return success; | |
767 } | |
768 | |
769 void OneContigSpaceCardGeneration::shrink_by(size_t bytes) { | |
770 assert_locked_or_safepoint(ExpandHeap_lock); | |
771 // Shrink committed space | |
772 _virtual_space.shrink_by(bytes); | |
773 // Shrink space; this also shrinks the space's BOT | |
774 _the_space->set_end((HeapWord*) _virtual_space.high()); | |
775 size_t new_word_size = heap_word_size(_the_space->capacity()); | |
776 // Shrink the shared block offset array | |
777 _bts->resize(new_word_size); | |
778 MemRegion mr(_the_space->bottom(), new_word_size); | |
779 // Shrink the card table | |
780 Universe::heap()->barrier_set()->resize_covered_region(mr); | |
781 | |
782 if (Verbose && PrintGC) { | |
783 size_t new_mem_size = _virtual_space.committed_size(); | |
784 size_t old_mem_size = new_mem_size + bytes; | |
785 gclog_or_tty->print_cr("Shrinking %s from " SIZE_FORMAT "K to " SIZE_FORMAT "K", | |
786 name(), old_mem_size/K, new_mem_size/K); | |
787 } | |
788 } | |
789 | |
790 // Currently nothing to do. | |
791 void OneContigSpaceCardGeneration::prepare_for_verify() {} | |
792 | |
793 | |
1051
26f1542097f1
6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents:
579
diff
changeset
|
794 // Override for a card-table generation with one contiguous |
26f1542097f1
6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents:
579
diff
changeset
|
795 // space. NOTE: For reasons that are lost in the fog of history, |
26f1542097f1
6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents:
579
diff
changeset
|
796 // this code is used when you iterate over perm gen objects, |
26f1542097f1
6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents:
579
diff
changeset
|
797 // even when one uses CDS, where the perm gen has a couple of |
26f1542097f1
6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents:
579
diff
changeset
|
798 // other spaces; this is because CompactingPermGenGen derives |
26f1542097f1
6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents:
579
diff
changeset
|
799 // from OneContigSpaceCardGeneration. This should be cleaned up, |
26f1542097f1
6801625: CDS: HeapDump tests crash with internal error in compactingPermGenGen.cpp
ysr
parents:
579
diff
changeset
|
800 // see CR 6897789.. |
0 | 801 void OneContigSpaceCardGeneration::object_iterate(ObjectClosure* blk) { |
802 _the_space->object_iterate(blk); | |
803 } | |
804 | |
805 void OneContigSpaceCardGeneration::space_iterate(SpaceClosure* blk, | |
806 bool usedOnly) { | |
807 blk->do_space(_the_space); | |
808 } | |
809 | |
810 void OneContigSpaceCardGeneration::younger_refs_iterate(OopsInGenClosure* blk) { | |
811 blk->set_generation(this); | |
812 younger_refs_in_space_iterate(_the_space, blk); | |
813 blk->reset_generation(); | |
814 } | |
815 | |
816 void OneContigSpaceCardGeneration::save_marks() { | |
817 _the_space->set_saved_mark(); | |
818 } | |
819 | |
820 | |
821 void OneContigSpaceCardGeneration::reset_saved_marks() { | |
822 _the_space->reset_saved_mark(); | |
823 } | |
824 | |
825 | |
826 bool OneContigSpaceCardGeneration::no_allocs_since_save_marks() { | |
827 return _the_space->saved_mark_at_top(); | |
828 } | |
829 | |
830 #define OneContig_SINCE_SAVE_MARKS_ITERATE_DEFN(OopClosureType, nv_suffix) \ | |
831 \ | |
832 void OneContigSpaceCardGeneration:: \ | |
833 oop_since_save_marks_iterate##nv_suffix(OopClosureType* blk) { \ | |
834 blk->set_generation(this); \ | |
835 _the_space->oop_since_save_marks_iterate##nv_suffix(blk); \ | |
836 blk->reset_generation(); \ | |
837 save_marks(); \ | |
838 } | |
839 | |
840 ALL_SINCE_SAVE_MARKS_CLOSURES(OneContig_SINCE_SAVE_MARKS_ITERATE_DEFN) | |
841 | |
842 #undef OneContig_SINCE_SAVE_MARKS_ITERATE_DEFN | |
843 | |
844 | |
845 void OneContigSpaceCardGeneration::gc_epilogue(bool full) { | |
846 _last_gc = WaterMark(the_space(), the_space()->top()); | |
847 | |
848 // update the generation and space performance counters | |
849 update_counters(); | |
263
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
850 if (ZapUnusedHeapArea) { |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
851 the_space()->check_mangled_unused_area_complete(); |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
852 } |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
853 } |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
854 |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
855 void OneContigSpaceCardGeneration::record_spaces_top() { |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
856 assert(ZapUnusedHeapArea, "Not mangling unused space"); |
12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
jmasa
parents:
113
diff
changeset
|
857 the_space()->set_top_for_allocations(); |
0 | 858 } |
859 | |
6008 | 860 void OneContigSpaceCardGeneration::verify() { |
861 the_space()->verify(); | |
0 | 862 } |
863 | |
864 void OneContigSpaceCardGeneration::print_on(outputStream* st) const { | |
865 Generation::print_on(st); | |
866 st->print(" the"); | |
867 the_space()->print_on(st); | |
868 } |