12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "gc/parallel/objectStartArray.inline.hpp"
26 #include "gc/parallel/parallelArguments.hpp"
27 #include "gc/parallel/parallelInitLogger.hpp"
28 #include "gc/parallel/parallelScavengeHeap.inline.hpp"
29 #include "gc/parallel/psAdaptiveSizePolicy.hpp"
30 #include "gc/parallel/psMemoryPool.hpp"
31 #include "gc/parallel/psParallelCompact.inline.hpp"
32 #include "gc/parallel/psPromotionManager.hpp"
33 #include "gc/parallel/psScavenge.hpp"
34 #include "gc/parallel/psVMOperations.hpp"
35 #include "gc/shared/fullGCForwarding.inline.hpp"
36 #include "gc/shared/gcHeapSummary.hpp"
37 #include "gc/shared/gcLocker.inline.hpp"
38 #include "gc/shared/gcWhen.hpp"
39 #include "gc/shared/genArguments.hpp"
40 #include "gc/shared/locationPrinter.inline.hpp"
41 #include "gc/shared/scavengableNMethods.hpp"
42 #include "gc/shared/suspendibleThreadSet.hpp"
43 #include "logging/log.hpp"
44 #include "memory/iterator.hpp"
45 #include "memory/metaspaceCounters.hpp"
46 #include "memory/metaspaceUtils.hpp"
47 #include "memory/reservedSpace.hpp"
48 #include "memory/universe.hpp"
49 #include "oops/oop.inline.hpp"
50 #include "runtime/cpuTimeCounters.hpp"
51 #include "runtime/handles.inline.hpp"
102
103 const size_t eden_capacity = _young_gen->eden_space()->capacity_in_bytes();
104 const size_t old_capacity = _old_gen->capacity_in_bytes();
105 const size_t initial_promo_size = MIN2(eden_capacity, old_capacity);
106 _size_policy =
107 new PSAdaptiveSizePolicy(eden_capacity,
108 initial_promo_size,
109 young_gen()->to_space()->capacity_in_bytes(),
110 SpaceAlignment,
111 max_gc_pause_sec,
112 GCTimeRatio
113 );
114
115 assert((old_gen()->virtual_space()->high_boundary() ==
116 young_gen()->virtual_space()->low_boundary()),
117 "Boundaries must meet");
118 // initialize the policy counters - 2 collectors, 2 generations
119 _gc_policy_counters =
120 new PSGCAdaptivePolicyCounters("ParScav:MSC", 2, 2, _size_policy);
121
122 if (!PSParallelCompact::initialize_aux_data()) {
123 return JNI_ENOMEM;
124 }
125
126 // Create CPU time counter
127 CPUTimeCounters::create_counter(CPUTimeGroups::CPUTimeType::gc_parallel_workers);
128
129 ParallelInitLogger::print();
130
131 FullGCForwarding::initialize(_reserved);
132
133 return JNI_OK;
134 }
135
136 void ParallelScavengeHeap::initialize_serviceability() {
137
138 _eden_pool = new EdenMutableSpacePool(_young_gen,
139 _young_gen->eden_space(),
140 "PS Eden Space",
141 false /* support_usage_threshold */);
142
143 _survivor_pool = new SurvivorMutableSpacePool(_young_gen,
166 }
167 }
168
169 void ParallelScavengeHeap::safepoint_synchronize_end() {
170 if (UseStringDeduplication) {
171 SuspendibleThreadSet::desynchronize();
172 }
173 }
174 class PSIsScavengable : public BoolObjectClosure {
175 bool do_object_b(oop obj) {
176 return ParallelScavengeHeap::heap()->is_in_young(obj);
177 }
178 };
179
180 static PSIsScavengable _is_scavengable;
181
182 void ParallelScavengeHeap::post_initialize() {
183 CollectedHeap::post_initialize();
184 // Need to init the tenuring threshold
185 PSScavenge::initialize();
186 PSParallelCompact::post_initialize();
187 PSPromotionManager::initialize();
188
189 ScavengableNMethods::initialize(&_is_scavengable);
190 GCLocker::initialize();
191 }
192
193 void ParallelScavengeHeap::update_counters() {
194 young_gen()->update_counters();
195 old_gen()->update_counters();
196 MetaspaceCounters::update_performance_counters();
197 update_parallel_worker_threads_cpu_time();
198 }
199
200 size_t ParallelScavengeHeap::capacity() const {
201 size_t value = young_gen()->capacity_in_bytes() + old_gen()->capacity_in_bytes();
202 return value;
203 }
204
205 size_t ParallelScavengeHeap::used() const {
206 size_t value = young_gen()->used_in_bytes() + old_gen()->used_in_bytes();
367
368 HeapWord* ParallelScavengeHeap::allocate_old_gen_and_record(size_t size) {
369 assert_locked_or_safepoint(Heap_lock);
370 HeapWord* res = old_gen()->allocate(size);
371 if (res != nullptr) {
372 _size_policy->tenured_allocation(size * HeapWordSize);
373 }
374 return res;
375 }
376
377 HeapWord* ParallelScavengeHeap::mem_allocate_old_gen(size_t size) {
378 if (!should_alloc_in_eden(size)) {
379 // Size is too big for eden.
380 return allocate_old_gen_and_record(size);
381 }
382
383 return nullptr;
384 }
385
386 void ParallelScavengeHeap::do_full_collection(bool clear_all_soft_refs) {
387 PSParallelCompact::invoke(clear_all_soft_refs);
388 }
389
390 HeapWord* ParallelScavengeHeap::expand_heap_and_allocate(size_t size, bool is_tlab) {
391 HeapWord* result = nullptr;
392
393 result = young_gen()->allocate(size);
394 if (result == nullptr && !is_tlab) {
395 result = old_gen()->expand_and_allocate(size);
396 }
397 return result; // Could be null if we are out of space.
398 }
399
400 HeapWord* ParallelScavengeHeap::satisfy_failed_allocation(size_t size, bool is_tlab) {
401 assert(size != 0, "precondition");
402
403 HeapWord* result = nullptr;
404
405 // If young-gen can handle this allocation, attempt young-gc firstly.
406 bool should_run_young_gc = is_tlab || should_alloc_in_eden(size);
407 collect_at_safepoint(!should_run_young_gc);
408
409 result = expand_heap_and_allocate(size, is_tlab);
410 if (result != nullptr) {
411 return result;
412 }
413
414 // If we reach this point, we're really out of memory. Try every trick
415 // we can to reclaim memory. Force collection of soft references. Force
416 // a complete compaction of the heap. Any additional methods for finding
417 // free memory should be here, especially if they are expensive. If this
418 // attempt fails, an OOM exception will be thrown.
419 {
420 // Make sure the heap is fully compacted
421 uintx old_interval = HeapMaximumCompactionInterval;
422 HeapMaximumCompactionInterval = 0;
423
424 const bool clear_all_soft_refs = true;
425 PSParallelCompact::invoke(clear_all_soft_refs);
426
427 // Restore
428 HeapMaximumCompactionInterval = old_interval;
429 }
430
431 result = expand_heap_and_allocate(size, is_tlab);
432 if (result != nullptr) {
433 return result;
434 }
435
436 // What else? We might try synchronous finalization later. If the total
437 // space available is large enough for the allocation, then a more
438 // complete compaction phase than we've tried so far might be
439 // appropriate.
440 return nullptr;
441 }
442
443
444 void ParallelScavengeHeap::ensure_parsability(bool retire_tlabs) {
445 CollectedHeap::ensure_parsability(retire_tlabs);
446 young_gen()->eden_space()->ensure_parsability();
447 }
448
449 size_t ParallelScavengeHeap::tlab_capacity(Thread* thr) const {
450 return young_gen()->eden_space()->tlab_capacity(thr);
451 }
452
453 size_t ParallelScavengeHeap::tlab_used(Thread* thr) const {
454 return young_gen()->eden_space()->tlab_used(thr);
455 }
498 VM_ParallelGCCollect op(gc_count, full_gc_count, cause);
499 VMThread::execute(&op);
500 }
501
502 bool ParallelScavengeHeap::must_clear_all_soft_refs() {
503 return _gc_cause == GCCause::_metadata_GC_clear_soft_refs ||
504 _gc_cause == GCCause::_wb_full_gc;
505 }
506
507 void ParallelScavengeHeap::collect_at_safepoint(bool full) {
508 assert(!GCLocker::is_active(), "precondition");
509 bool clear_soft_refs = must_clear_all_soft_refs();
510
511 if (!full) {
512 bool success = PSScavenge::invoke(clear_soft_refs);
513 if (success) {
514 return;
515 }
516 // Upgrade to Full-GC if young-gc fails
517 }
518 PSParallelCompact::invoke(clear_soft_refs);
519 }
520
521 void ParallelScavengeHeap::object_iterate(ObjectClosure* cl) {
522 young_gen()->object_iterate(cl);
523 old_gen()->object_iterate(cl);
524 }
525
526 // The HeapBlockClaimer is used during parallel iteration over the heap,
527 // allowing workers to claim heap areas ("blocks"), gaining exclusive rights to these.
528 // The eden and survivor spaces are treated as single blocks as it is hard to divide
529 // these spaces.
530 // The old space is divided into fixed-size blocks.
531 class HeapBlockClaimer : public StackObj {
532 size_t _claimed_index;
533
534 public:
535 static const size_t InvalidIndex = SIZE_MAX;
536 static const size_t EdenIndex = 0;
537 static const size_t SurvivorIndex = 1;
538 static const size_t NumNonOldGenClaims = 2;
641 bool ParallelScavengeHeap::print_location(outputStream* st, void* addr) const {
642 return BlockLocationPrinter<ParallelScavengeHeap>::print_location(st, addr);
643 }
644
645 void ParallelScavengeHeap::print_heap_on(outputStream* st) const {
646 if (young_gen() != nullptr) {
647 young_gen()->print_on(st);
648 }
649 if (old_gen() != nullptr) {
650 old_gen()->print_on(st);
651 }
652 }
653
654 void ParallelScavengeHeap::print_gc_on(outputStream* st) const {
655 BarrierSet* bs = BarrierSet::barrier_set();
656 if (bs != nullptr) {
657 bs->print_on(st);
658 }
659 st->cr();
660
661 PSParallelCompact::print_on(st);
662 }
663
664 void ParallelScavengeHeap::gc_threads_do(ThreadClosure* tc) const {
665 ParallelScavengeHeap::heap()->workers().threads_do(tc);
666 }
667
668 void ParallelScavengeHeap::print_tracing_info() const {
669 AdaptiveSizePolicyOutput::print();
670 log_debug(gc, heap, exit)("Accumulated young generation GC time %3.7f secs", PSScavenge::accumulated_time()->seconds());
671 log_debug(gc, heap, exit)("Accumulated old generation GC time %3.7f secs", PSParallelCompact::accumulated_time()->seconds());
672 }
673
674 PreGenGCValues ParallelScavengeHeap::get_pre_gc_values() const {
675 const PSYoungGen* const young = young_gen();
676 const MutableSpace* const eden = young->eden_space();
677 const MutableSpace* const from = young->from_space();
678 const PSOldGen* const old = old_gen();
679
680 return PreGenGCValues(young->used_in_bytes(),
681 young->capacity_in_bytes(),
682 eden->used_in_bytes(),
683 eden->capacity_in_bytes(),
684 from->used_in_bytes(),
685 from->capacity_in_bytes(),
686 old->used_in_bytes(),
687 old->capacity_in_bytes());
688 }
689
690 void ParallelScavengeHeap::print_heap_change(const PreGenGCValues& pre_gc_values) const {
691 const PSYoungGen* const young = young_gen();
|
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "gc/parallel/objectStartArray.inline.hpp"
26 #include "gc/parallel/parallelArguments.hpp"
27 #include "gc/parallel/parallelInitLogger.hpp"
28 #include "gc/parallel/parallelScavengeHeap.inline.hpp"
29 #include "gc/parallel/psAdaptiveSizePolicy.hpp"
30 #include "gc/parallel/psMemoryPool.hpp"
31 #include "gc/parallel/psParallelCompact.inline.hpp"
32 #include "gc/parallel/psParallelCompactNew.inline.hpp"
33 #include "gc/parallel/psPromotionManager.hpp"
34 #include "gc/parallel/psScavenge.hpp"
35 #include "gc/parallel/psVMOperations.hpp"
36 #include "gc/shared/fullGCForwarding.inline.hpp"
37 #include "gc/shared/gcHeapSummary.hpp"
38 #include "gc/shared/gcLocker.inline.hpp"
39 #include "gc/shared/gcWhen.hpp"
40 #include "gc/shared/genArguments.hpp"
41 #include "gc/shared/locationPrinter.inline.hpp"
42 #include "gc/shared/scavengableNMethods.hpp"
43 #include "gc/shared/suspendibleThreadSet.hpp"
44 #include "logging/log.hpp"
45 #include "memory/iterator.hpp"
46 #include "memory/metaspaceCounters.hpp"
47 #include "memory/metaspaceUtils.hpp"
48 #include "memory/reservedSpace.hpp"
49 #include "memory/universe.hpp"
50 #include "oops/oop.inline.hpp"
51 #include "runtime/cpuTimeCounters.hpp"
52 #include "runtime/handles.inline.hpp"
103
104 const size_t eden_capacity = _young_gen->eden_space()->capacity_in_bytes();
105 const size_t old_capacity = _old_gen->capacity_in_bytes();
106 const size_t initial_promo_size = MIN2(eden_capacity, old_capacity);
107 _size_policy =
108 new PSAdaptiveSizePolicy(eden_capacity,
109 initial_promo_size,
110 young_gen()->to_space()->capacity_in_bytes(),
111 SpaceAlignment,
112 max_gc_pause_sec,
113 GCTimeRatio
114 );
115
116 assert((old_gen()->virtual_space()->high_boundary() ==
117 young_gen()->virtual_space()->low_boundary()),
118 "Boundaries must meet");
119 // initialize the policy counters - 2 collectors, 2 generations
120 _gc_policy_counters =
121 new PSGCAdaptivePolicyCounters("ParScav:MSC", 2, 2, _size_policy);
122
123 if (UseCompactObjectHeaders) {
124 if (!PSParallelCompactNew::initialize_aux_data()) {
125 return JNI_ENOMEM;
126 }
127 } else {
128 if (!PSParallelCompact::initialize_aux_data()) {
129 return JNI_ENOMEM;
130 }
131 }
132
133 // Create CPU time counter
134 CPUTimeCounters::create_counter(CPUTimeGroups::CPUTimeType::gc_parallel_workers);
135
136 ParallelInitLogger::print();
137
138 FullGCForwarding::initialize(_reserved);
139
140 return JNI_OK;
141 }
142
143 void ParallelScavengeHeap::initialize_serviceability() {
144
145 _eden_pool = new EdenMutableSpacePool(_young_gen,
146 _young_gen->eden_space(),
147 "PS Eden Space",
148 false /* support_usage_threshold */);
149
150 _survivor_pool = new SurvivorMutableSpacePool(_young_gen,
173 }
174 }
175
176 void ParallelScavengeHeap::safepoint_synchronize_end() {
177 if (UseStringDeduplication) {
178 SuspendibleThreadSet::desynchronize();
179 }
180 }
181 class PSIsScavengable : public BoolObjectClosure {
182 bool do_object_b(oop obj) {
183 return ParallelScavengeHeap::heap()->is_in_young(obj);
184 }
185 };
186
187 static PSIsScavengable _is_scavengable;
188
189 void ParallelScavengeHeap::post_initialize() {
190 CollectedHeap::post_initialize();
191 // Need to init the tenuring threshold
192 PSScavenge::initialize();
193 if (UseCompactObjectHeaders) {
194 PSParallelCompactNew::post_initialize();
195 } else {
196 PSParallelCompact::post_initialize();
197 }
198 PSPromotionManager::initialize();
199
200 ScavengableNMethods::initialize(&_is_scavengable);
201 GCLocker::initialize();
202 }
203
204 void ParallelScavengeHeap::update_counters() {
205 young_gen()->update_counters();
206 old_gen()->update_counters();
207 MetaspaceCounters::update_performance_counters();
208 update_parallel_worker_threads_cpu_time();
209 }
210
211 size_t ParallelScavengeHeap::capacity() const {
212 size_t value = young_gen()->capacity_in_bytes() + old_gen()->capacity_in_bytes();
213 return value;
214 }
215
216 size_t ParallelScavengeHeap::used() const {
217 size_t value = young_gen()->used_in_bytes() + old_gen()->used_in_bytes();
378
379 HeapWord* ParallelScavengeHeap::allocate_old_gen_and_record(size_t size) {
380 assert_locked_or_safepoint(Heap_lock);
381 HeapWord* res = old_gen()->allocate(size);
382 if (res != nullptr) {
383 _size_policy->tenured_allocation(size * HeapWordSize);
384 }
385 return res;
386 }
387
388 HeapWord* ParallelScavengeHeap::mem_allocate_old_gen(size_t size) {
389 if (!should_alloc_in_eden(size)) {
390 // Size is too big for eden.
391 return allocate_old_gen_and_record(size);
392 }
393
394 return nullptr;
395 }
396
397 void ParallelScavengeHeap::do_full_collection(bool clear_all_soft_refs) {
398 if (UseCompactObjectHeaders) {
399 PSParallelCompactNew::invoke(clear_all_soft_refs, false /* serial */);
400 } else {
401 PSParallelCompact::invoke(clear_all_soft_refs);
402 }
403 }
404
405 HeapWord* ParallelScavengeHeap::expand_heap_and_allocate(size_t size, bool is_tlab) {
406 HeapWord* result = nullptr;
407
408 result = young_gen()->allocate(size);
409 if (result == nullptr && !is_tlab) {
410 result = old_gen()->expand_and_allocate(size);
411 }
412 return result; // Could be null if we are out of space.
413 }
414
415 HeapWord* ParallelScavengeHeap::satisfy_failed_allocation(size_t size, bool is_tlab) {
416 assert(size != 0, "precondition");
417
418 HeapWord* result = nullptr;
419
420 // If young-gen can handle this allocation, attempt young-gc firstly.
421 bool should_run_young_gc = is_tlab || should_alloc_in_eden(size);
422 collect_at_safepoint(!should_run_young_gc);
423
424 result = expand_heap_and_allocate(size, is_tlab);
425 if (result != nullptr) {
426 return result;
427 }
428
429 // If we reach this point, we're really out of memory. Try every trick
430 // we can to reclaim memory. Force collection of soft references. Force
431 // a complete compaction of the heap. Any additional methods for finding
432 // free memory should be here, especially if they are expensive. If this
433 // attempt fails, an OOM exception will be thrown.
434 {
435 // Make sure the heap is fully compacted
436 uintx old_interval = HeapMaximumCompactionInterval;
437 HeapMaximumCompactionInterval = 0;
438
439 const bool clear_all_soft_refs = true;
440 if (UseCompactObjectHeaders) {
441 PSParallelCompactNew::invoke(clear_all_soft_refs, false /* serial */);
442 } else {
443 PSParallelCompact::invoke(clear_all_soft_refs);
444 }
445
446 // Restore
447 HeapMaximumCompactionInterval = old_interval;
448 }
449
450 result = expand_heap_and_allocate(size, is_tlab);
451 if (result != nullptr) {
452 return result;
453 }
454
455 if (UseCompactObjectHeaders) {
456 PSParallelCompactNew::invoke(true /* clear_soft_refs */, true /* serial */);
457 }
458
459 result = expand_heap_and_allocate(size, is_tlab);
460 if (result != nullptr) {
461 return result;
462 }
463
464 // What else? We might try synchronous finalization later. If the total
465 // space available is large enough for the allocation, then a more
466 // complete compaction phase than we've tried so far might be
467 // appropriate.
468 return nullptr;
469 }
470
471
472 void ParallelScavengeHeap::ensure_parsability(bool retire_tlabs) {
473 CollectedHeap::ensure_parsability(retire_tlabs);
474 young_gen()->eden_space()->ensure_parsability();
475 }
476
477 size_t ParallelScavengeHeap::tlab_capacity(Thread* thr) const {
478 return young_gen()->eden_space()->tlab_capacity(thr);
479 }
480
481 size_t ParallelScavengeHeap::tlab_used(Thread* thr) const {
482 return young_gen()->eden_space()->tlab_used(thr);
483 }
526 VM_ParallelGCCollect op(gc_count, full_gc_count, cause);
527 VMThread::execute(&op);
528 }
529
530 bool ParallelScavengeHeap::must_clear_all_soft_refs() {
531 return _gc_cause == GCCause::_metadata_GC_clear_soft_refs ||
532 _gc_cause == GCCause::_wb_full_gc;
533 }
534
535 void ParallelScavengeHeap::collect_at_safepoint(bool full) {
536 assert(!GCLocker::is_active(), "precondition");
537 bool clear_soft_refs = must_clear_all_soft_refs();
538
539 if (!full) {
540 bool success = PSScavenge::invoke(clear_soft_refs);
541 if (success) {
542 return;
543 }
544 // Upgrade to Full-GC if young-gc fails
545 }
546 if (UseCompactObjectHeaders) {
547 PSParallelCompactNew::invoke(clear_soft_refs, false /* serial */);
548 } else {
549 PSParallelCompact::invoke(clear_soft_refs);
550 }
551 }
552
553 void ParallelScavengeHeap::object_iterate(ObjectClosure* cl) {
554 young_gen()->object_iterate(cl);
555 old_gen()->object_iterate(cl);
556 }
557
558 // The HeapBlockClaimer is used during parallel iteration over the heap,
559 // allowing workers to claim heap areas ("blocks"), gaining exclusive rights to these.
560 // The eden and survivor spaces are treated as single blocks as it is hard to divide
561 // these spaces.
562 // The old space is divided into fixed-size blocks.
563 class HeapBlockClaimer : public StackObj {
564 size_t _claimed_index;
565
566 public:
567 static const size_t InvalidIndex = SIZE_MAX;
568 static const size_t EdenIndex = 0;
569 static const size_t SurvivorIndex = 1;
570 static const size_t NumNonOldGenClaims = 2;
673 bool ParallelScavengeHeap::print_location(outputStream* st, void* addr) const {
674 return BlockLocationPrinter<ParallelScavengeHeap>::print_location(st, addr);
675 }
676
677 void ParallelScavengeHeap::print_heap_on(outputStream* st) const {
678 if (young_gen() != nullptr) {
679 young_gen()->print_on(st);
680 }
681 if (old_gen() != nullptr) {
682 old_gen()->print_on(st);
683 }
684 }
685
686 void ParallelScavengeHeap::print_gc_on(outputStream* st) const {
687 BarrierSet* bs = BarrierSet::barrier_set();
688 if (bs != nullptr) {
689 bs->print_on(st);
690 }
691 st->cr();
692
693 if (UseCompactObjectHeaders) {
694 PSParallelCompactNew::print_on(st);
695 } else {
696 PSParallelCompact::print_on(st);
697 }
698 }
699
700 void ParallelScavengeHeap::gc_threads_do(ThreadClosure* tc) const {
701 ParallelScavengeHeap::heap()->workers().threads_do(tc);
702 }
703
704 void ParallelScavengeHeap::print_tracing_info() const {
705 AdaptiveSizePolicyOutput::print();
706 log_debug(gc, heap, exit)("Accumulated young generation GC time %3.7f secs", PSScavenge::accumulated_time()->seconds());
707 if (UseCompactObjectHeaders) {
708 log_debug(gc, heap, exit)("Accumulated old generation GC time %3.7f secs", PSParallelCompactNew::accumulated_time()->seconds());
709 } else {
710 log_debug(gc, heap, exit)("Accumulated old generation GC time %3.7f secs", PSParallelCompact::accumulated_time()->seconds());
711 }
712 }
713
714 PreGenGCValues ParallelScavengeHeap::get_pre_gc_values() const {
715 const PSYoungGen* const young = young_gen();
716 const MutableSpace* const eden = young->eden_space();
717 const MutableSpace* const from = young->from_space();
718 const PSOldGen* const old = old_gen();
719
720 return PreGenGCValues(young->used_in_bytes(),
721 young->capacity_in_bytes(),
722 eden->used_in_bytes(),
723 eden->capacity_in_bytes(),
724 from->used_in_bytes(),
725 from->capacity_in_bytes(),
726 old->used_in_bytes(),
727 old->capacity_in_bytes());
728 }
729
730 void ParallelScavengeHeap::print_heap_change(const PreGenGCValues& pre_gc_values) const {
731 const PSYoungGen* const young = young_gen();
|