< prev index next >

src/hotspot/share/gc/parallel/parallelScavengeHeap.cpp

Print this page


   1 /*
   2  * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
   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  *
  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 "precompiled.hpp"
  26 #include "code/codeCache.hpp"
  27 #include "gc/parallel/adjoiningGenerations.hpp"
  28 #include "gc/parallel/adjoiningGenerationsForHeteroHeap.hpp"
  29 #include "gc/parallel/adjoiningVirtualSpaces.hpp"
  30 #include "gc/parallel/parallelArguments.hpp"

  31 #include "gc/parallel/objectStartArray.inline.hpp"
  32 #include "gc/parallel/parallelScavengeHeap.inline.hpp"
  33 #include "gc/parallel/psAdaptiveSizePolicy.hpp"
  34 #include "gc/parallel/psMarkSweepProxy.hpp"
  35 #include "gc/parallel/psMemoryPool.hpp"
  36 #include "gc/parallel/psParallelCompact.inline.hpp"
  37 #include "gc/parallel/psPromotionManager.hpp"
  38 #include "gc/parallel/psScavenge.hpp"
  39 #include "gc/parallel/psVMOperations.hpp"
  40 #include "gc/shared/gcHeapSummary.hpp"
  41 #include "gc/shared/gcLocker.hpp"
  42 #include "gc/shared/gcWhen.hpp"
  43 #include "gc/shared/genArguments.hpp"
  44 #include "gc/shared/locationPrinter.inline.hpp"
  45 #include "gc/shared/scavengableNMethods.hpp"
  46 #include "logging/log.hpp"
  47 #include "memory/metaspaceCounters.hpp"
  48 #include "memory/universe.hpp"
  49 #include "oops/oop.inline.hpp"
  50 #include "runtime/handles.inline.hpp"
  51 #include "runtime/java.hpp"
  52 #include "runtime/vmThread.hpp"
  53 #include "services/memoryManager.hpp"
  54 #include "services/memTracker.hpp"
  55 #include "utilities/macros.hpp"
  56 #include "utilities/vmError.hpp"
  57 
  58 PSYoungGen*  ParallelScavengeHeap::_young_gen = NULL;
  59 PSOldGen*    ParallelScavengeHeap::_old_gen = NULL;
  60 PSAdaptiveSizePolicy* ParallelScavengeHeap::_size_policy = NULL;
  61 PSGCAdaptivePolicyCounters* ParallelScavengeHeap::_gc_policy_counters = NULL;

  62 
  63 jint ParallelScavengeHeap::initialize() {
  64   const size_t reserved_heap_size = ParallelArguments::heap_reserved_size_bytes();
  65 
  66   ReservedHeapSpace heap_rs = Universe::reserve_heap(reserved_heap_size, HeapAlignment);
  67 
  68   os::trace_page_sizes("Heap",
  69                        MinHeapSize,
  70                        reserved_heap_size,
  71                        GenAlignment,
  72                        heap_rs.base(),
  73                        heap_rs.size());
  74 
  75   initialize_reserved_region(heap_rs);
  76 
  77   PSCardTable* card_table = new PSCardTable(heap_rs.region());
  78   card_table->initialize();
  79   CardTableBarrierSet* const barrier_set = new CardTableBarrierSet(card_table);
  80   barrier_set->initialize();
  81   BarrierSet::set_barrier_set(barrier_set);
  82 
  83   // Make up the generations
  84   // Calculate the maximum size that a generation can grow.  This
  85   // includes growth into the other generation.  Note that the
  86   // parameter _max_gen_size is kept as the maximum
  87   // size of the generation as the boundaries currently stand.
  88   // _max_gen_size is still used as that value.
  89   double max_gc_pause_sec = ((double) MaxGCPauseMillis)/1000.0;
  90   double max_gc_minor_pause_sec = ((double) MaxGCMinorPauseMillis)/1000.0;
  91 
  92   _gens = AdjoiningGenerations::create_adjoining_generations(heap_rs);
  93 
  94   _old_gen = _gens->old_gen();
  95   _young_gen = _gens->young_gen();
  96 
  97   const size_t eden_capacity = _young_gen->eden_space()->capacity_in_bytes();
  98   const size_t old_capacity = _old_gen->capacity_in_bytes();
  99   const size_t initial_promo_size = MIN2(eden_capacity, old_capacity);
 100   _size_policy =
 101     new PSAdaptiveSizePolicy(eden_capacity,
 102                              initial_promo_size,
 103                              young_gen()->to_space()->capacity_in_bytes(),
 104                              GenAlignment,
 105                              max_gc_pause_sec,
 106                              max_gc_minor_pause_sec,
 107                              GCTimeRatio
 108                              );
 109 
 110   assert(ParallelArguments::is_heterogeneous_heap() || !UseAdaptiveGCBoundary ||
 111     (old_gen()->virtual_space()->high_boundary() ==
 112      young_gen()->virtual_space()->low_boundary()),
 113     "Boundaries must meet");
 114   // initialize the policy counters - 2 collectors, 2 generations
 115   _gc_policy_counters =
 116     new PSGCAdaptivePolicyCounters("ParScav:MSC", 2, 2, _size_policy);
 117 



 118   if (UseParallelOldGC && !PSParallelCompact::initialize()) {
 119     return JNI_ENOMEM;
 120   }
 121 
 122   // Set up WorkGang
 123   _workers.initialize_workers();
 124 
 125   return JNI_OK;
 126 }
 127 
 128 void ParallelScavengeHeap::initialize_serviceability() {
 129 
 130   _eden_pool = new EdenMutableSpacePool(_young_gen,
 131                                         _young_gen->eden_space(),
 132                                         "PS Eden Space",
 133                                         false /* support_usage_threshold */);
 134 
 135   _survivor_pool = new SurvivorMutableSpacePool(_young_gen,
 136                                                 "PS Survivor Space",
 137                                                 false /* support_usage_threshold */);
 138 
 139   _old_pool = new PSGenerationPool(_old_gen,
 140                                    "PS Old Gen",
 141                                    true /* support_usage_threshold */);
 142 
 143   _young_manager = new GCMemoryManager("PS Scavenge", "end of minor GC");
 144   _old_manager = new GCMemoryManager("PS MarkSweep", "end of major GC");


 502 }
 503 
 504 void ParallelScavengeHeap::resize_all_tlabs() {
 505   CollectedHeap::resize_all_tlabs();
 506 }
 507 
 508 // This method is used by System.gc() and JVMTI.
 509 void ParallelScavengeHeap::collect(GCCause::Cause cause) {
 510   assert(!Heap_lock->owned_by_self(),
 511     "this thread should not own the Heap_lock");
 512 
 513   uint gc_count      = 0;
 514   uint full_gc_count = 0;
 515   {
 516     MutexLocker ml(Heap_lock);
 517     // This value is guarded by the Heap_lock
 518     gc_count      = total_collections();
 519     full_gc_count = total_full_collections();
 520   }
 521 
 522   if (GCLocker::should_discard(cause, gc_count)) {
 523     return;
 524   }
 525 
 526   VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause);
 527   VMThread::execute(&op);
 528 }
 529 
 530 void ParallelScavengeHeap::object_iterate(ObjectClosure* cl) {
 531   young_gen()->object_iterate(cl);
 532   old_gen()->object_iterate(cl);
 533 }
 534 
 535 
 536 HeapWord* ParallelScavengeHeap::block_start(const void* addr) const {
 537   if (young_gen()->is_in_reserved(addr)) {
 538     assert(young_gen()->is_in(addr),
 539            "addr should be in allocated part of young gen");
 540     // called from os::print_location by find or VMError
 541     if (Debugging || VMError::fatal_error_in_progress())  return NULL;
 542     Unimplemented();
 543   } else if (old_gen()->is_in_reserved(addr)) {
 544     assert(old_gen()->is_in(addr),
 545            "addr should be in allocated part of old gen");


 568   VirtualSpaceSummary old_summary(old->reserved().start(), old_committed_end, old->reserved().end());
 569   SpaceSummary old_space(old->reserved().start(), old_committed_end, old->used_in_bytes());
 570 
 571   PSYoungGen* young = young_gen();
 572   VirtualSpaceSummary young_summary(young->reserved().start(),
 573     (HeapWord*)young->virtual_space()->committed_high_addr(), young->reserved().end());
 574 
 575   MutableSpace* eden = young_gen()->eden_space();
 576   SpaceSummary eden_space(eden->bottom(), eden->end(), eden->used_in_bytes());
 577 
 578   MutableSpace* from = young_gen()->from_space();
 579   SpaceSummary from_space(from->bottom(), from->end(), from->used_in_bytes());
 580 
 581   MutableSpace* to = young_gen()->to_space();
 582   SpaceSummary to_space(to->bottom(), to->end(), to->used_in_bytes());
 583 
 584   VirtualSpaceSummary heap_summary = create_heap_space_summary();
 585   return PSHeapSummary(heap_summary, used(), old_summary, old_space, young_summary, eden_space, from_space, to_space);
 586 }
 587 
 588 bool ParallelScavengeHeap::print_location(outputStream* st, void* addr) const {
 589   return BlockLocationPrinter<ParallelScavengeHeap>::print_location(st, addr);
 590 }
 591 
 592 void ParallelScavengeHeap::print_on(outputStream* st) const {
 593   young_gen()->print_on(st);
 594   old_gen()->print_on(st);
 595   MetaspaceUtils::print_on(st);
 596 }
 597 
 598 void ParallelScavengeHeap::print_on_error(outputStream* st) const {
 599   this->CollectedHeap::print_on_error(st);
 600 
 601   if (UseParallelOldGC) {
 602     st->cr();
 603     PSParallelCompact::print_on_error(st);
 604   }
 605 }
 606 
 607 void ParallelScavengeHeap::gc_threads_do(ThreadClosure* tc) const {
 608   ParallelScavengeHeap::heap()->workers().threads_do(tc);
 609 }
 610 
 611 void ParallelScavengeHeap::print_gc_threads_on(outputStream* st) const {
 612   ParallelScavengeHeap::heap()->workers().print_worker_threads_on(st);
 613 }
 614 
 615 void ParallelScavengeHeap::print_tracing_info() const {
 616   AdaptiveSizePolicyOutput::print();
 617   log_debug(gc, heap, exit)("Accumulated young generation GC time %3.7f secs", PSScavenge::accumulated_time()->seconds());
 618   log_debug(gc, heap, exit)("Accumulated old generation GC time %3.7f secs",
 619       UseParallelOldGC ? PSParallelCompact::accumulated_time()->seconds() : PSMarkSweepProxy::accumulated_time()->seconds());
 620 }
 621 
 622 PreGenGCValues ParallelScavengeHeap::get_pre_gc_values() const {
 623   const PSYoungGen* const young = young_gen();
 624   const MutableSpace* const eden = young->eden_space();
 625   const MutableSpace* const from = young->from_space();
 626   const PSOldGen* const old = old_gen();
 627 
 628   return PreGenGCValues(young->used_in_bytes(),
 629                         young->capacity_in_bytes(),
 630                         eden->used_in_bytes(),
 631                         eden->capacity_in_bytes(),
 632                         from->used_in_bytes(),
 633                         from->capacity_in_bytes(),
 634                         old->used_in_bytes(),
 635                         old->capacity_in_bytes());
 636 }
 637 
 638 void ParallelScavengeHeap::print_heap_change(const PreGenGCValues& pre_gc_values) const {
 639   const PSYoungGen* const young = young_gen();
 640   const MutableSpace* const eden = young->eden_space();
 641   const MutableSpace* const from = young->from_space();
 642   const PSOldGen* const old = old_gen();
 643 
 644   log_info(gc, heap)(HEAP_CHANGE_FORMAT" "
 645                      HEAP_CHANGE_FORMAT" "
 646                      HEAP_CHANGE_FORMAT,
 647                      HEAP_CHANGE_FORMAT_ARGS(young->name(),
 648                                              pre_gc_values.young_gen_used(),
 649                                              pre_gc_values.young_gen_capacity(),
 650                                              young->used_in_bytes(),
 651                                              young->capacity_in_bytes()),
 652                      HEAP_CHANGE_FORMAT_ARGS("Eden",
 653                                              pre_gc_values.eden_used(),
 654                                              pre_gc_values.eden_capacity(),
 655                                              eden->used_in_bytes(),
 656                                              eden->capacity_in_bytes()),
 657                      HEAP_CHANGE_FORMAT_ARGS("From",
 658                                              pre_gc_values.from_used(),
 659                                              pre_gc_values.from_capacity(),
 660                                              from->used_in_bytes(),
 661                                              from->capacity_in_bytes()));
 662   log_info(gc, heap)(HEAP_CHANGE_FORMAT,
 663                      HEAP_CHANGE_FORMAT_ARGS(old->name(),
 664                                              pre_gc_values.old_gen_used(),
 665                                              pre_gc_values.old_gen_capacity(),
 666                                              old->used_in_bytes(),
 667                                              old->capacity_in_bytes()));
 668   MetaspaceUtils::print_metaspace_change(pre_gc_values.metaspace_sizes());
 669 }
 670 
 671 void ParallelScavengeHeap::verify(VerifyOption option /* ignored */) {
 672   // Why do we need the total_collections()-filter below?
 673   if (total_collections() > 0) {
 674     log_debug(gc, verify)("Tenured");
 675     old_gen()->verify();
 676 
 677     log_debug(gc, verify)("Eden");
 678     young_gen()->verify();
 679   }
 680 }
 681 
 682 void ParallelScavengeHeap::trace_heap(GCWhen::Type when, const GCTracer* gc_tracer) {
 683   const PSHeapSummary& heap_summary = create_ps_heap_summary();
 684   gc_tracer->report_gc_heap_summary(when, heap_summary);
 685 
 686   const MetaspaceSummary& metaspace_summary = create_metaspace_summary();
 687   gc_tracer->report_metaspace_summary(when, metaspace_summary);
 688 }
 689 


   1 /*
   2  * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
   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  *
  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 "precompiled.hpp"
  26 #include "code/codeCache.hpp"
  27 #include "gc/parallel/adjoiningGenerations.hpp"
  28 #include "gc/parallel/adjoiningGenerationsForHeteroHeap.hpp"
  29 #include "gc/parallel/adjoiningVirtualSpaces.hpp"
  30 #include "gc/parallel/parallelArguments.hpp"
  31 #include "gc/parallel/gcTaskManager.hpp"
  32 #include "gc/parallel/objectStartArray.inline.hpp"
  33 #include "gc/parallel/parallelScavengeHeap.inline.hpp"
  34 #include "gc/parallel/psAdaptiveSizePolicy.hpp"
  35 #include "gc/parallel/psMarkSweepProxy.hpp"
  36 #include "gc/parallel/psMemoryPool.hpp"
  37 #include "gc/parallel/psParallelCompact.inline.hpp"
  38 #include "gc/parallel/psPromotionManager.hpp"
  39 #include "gc/parallel/psScavenge.hpp"
  40 #include "gc/parallel/psVMOperations.hpp"
  41 #include "gc/shared/gcHeapSummary.hpp"
  42 #include "gc/shared/gcLocker.hpp"
  43 #include "gc/shared/gcWhen.hpp"
  44 #include "gc/shared/genArguments.hpp"

  45 #include "gc/shared/scavengableNMethods.hpp"
  46 #include "logging/log.hpp"
  47 #include "memory/metaspaceCounters.hpp"
  48 #include "memory/universe.hpp"
  49 #include "oops/oop.inline.hpp"
  50 #include "runtime/handles.inline.hpp"
  51 #include "runtime/java.hpp"
  52 #include "runtime/vmThread.hpp"
  53 #include "services/memoryManager.hpp"
  54 #include "services/memTracker.hpp"
  55 #include "utilities/macros.hpp"
  56 #include "utilities/vmError.hpp"
  57 
  58 PSYoungGen*  ParallelScavengeHeap::_young_gen = NULL;
  59 PSOldGen*    ParallelScavengeHeap::_old_gen = NULL;
  60 PSAdaptiveSizePolicy* ParallelScavengeHeap::_size_policy = NULL;
  61 PSGCAdaptivePolicyCounters* ParallelScavengeHeap::_gc_policy_counters = NULL;
  62 GCTaskManager* ParallelScavengeHeap::_gc_task_manager = NULL;
  63 
  64 jint ParallelScavengeHeap::initialize() {
  65   const size_t reserved_heap_size = ParallelArguments::heap_reserved_size_bytes();
  66 
  67   ReservedSpace heap_rs = Universe::reserve_heap(reserved_heap_size, HeapAlignment);
  68 
  69   os::trace_page_sizes("Heap",
  70                        MinHeapSize,
  71                        reserved_heap_size,
  72                        GenAlignment,
  73                        heap_rs.base(),
  74                        heap_rs.size());
  75 
  76   initialize_reserved_region((HeapWord*)heap_rs.base(), (HeapWord*)(heap_rs.base() + heap_rs.size()));
  77 
  78   PSCardTable* card_table = new PSCardTable(reserved_region());
  79   card_table->initialize();
  80   CardTableBarrierSet* const barrier_set = new CardTableBarrierSet(card_table);
  81   barrier_set->initialize();
  82   BarrierSet::set_barrier_set(barrier_set);
  83 
  84   // Make up the generations
  85   // Calculate the maximum size that a generation can grow.  This
  86   // includes growth into the other generation.  Note that the
  87   // parameter _max_gen_size is kept as the maximum
  88   // size of the generation as the boundaries currently stand.
  89   // _max_gen_size is still used as that value.
  90   double max_gc_pause_sec = ((double) MaxGCPauseMillis)/1000.0;
  91   double max_gc_minor_pause_sec = ((double) MaxGCMinorPauseMillis)/1000.0;
  92 
  93   _gens = AdjoiningGenerations::create_adjoining_generations(heap_rs);
  94 
  95   _old_gen = _gens->old_gen();
  96   _young_gen = _gens->young_gen();
  97 
  98   const size_t eden_capacity = _young_gen->eden_space()->capacity_in_bytes();
  99   const size_t old_capacity = _old_gen->capacity_in_bytes();
 100   const size_t initial_promo_size = MIN2(eden_capacity, old_capacity);
 101   _size_policy =
 102     new PSAdaptiveSizePolicy(eden_capacity,
 103                              initial_promo_size,
 104                              young_gen()->to_space()->capacity_in_bytes(),
 105                              GenAlignment,
 106                              max_gc_pause_sec,
 107                              max_gc_minor_pause_sec,
 108                              GCTimeRatio
 109                              );
 110 
 111   assert(ParallelArguments::is_heterogeneous_heap() || !UseAdaptiveGCBoundary ||
 112     (old_gen()->virtual_space()->high_boundary() ==
 113      young_gen()->virtual_space()->low_boundary()),
 114     "Boundaries must meet");
 115   // initialize the policy counters - 2 collectors, 2 generations
 116   _gc_policy_counters =
 117     new PSGCAdaptivePolicyCounters("ParScav:MSC", 2, 2, _size_policy);
 118 
 119   // Set up the GCTaskManager
 120   _gc_task_manager = GCTaskManager::create(ParallelGCThreads);
 121 
 122   if (UseParallelOldGC && !PSParallelCompact::initialize()) {
 123     return JNI_ENOMEM;
 124   }
 125 



 126   return JNI_OK;
 127 }
 128 
 129 void ParallelScavengeHeap::initialize_serviceability() {
 130 
 131   _eden_pool = new EdenMutableSpacePool(_young_gen,
 132                                         _young_gen->eden_space(),
 133                                         "PS Eden Space",
 134                                         false /* support_usage_threshold */);
 135 
 136   _survivor_pool = new SurvivorMutableSpacePool(_young_gen,
 137                                                 "PS Survivor Space",
 138                                                 false /* support_usage_threshold */);
 139 
 140   _old_pool = new PSGenerationPool(_old_gen,
 141                                    "PS Old Gen",
 142                                    true /* support_usage_threshold */);
 143 
 144   _young_manager = new GCMemoryManager("PS Scavenge", "end of minor GC");
 145   _old_manager = new GCMemoryManager("PS MarkSweep", "end of major GC");


 503 }
 504 
 505 void ParallelScavengeHeap::resize_all_tlabs() {
 506   CollectedHeap::resize_all_tlabs();
 507 }
 508 
 509 // This method is used by System.gc() and JVMTI.
 510 void ParallelScavengeHeap::collect(GCCause::Cause cause) {
 511   assert(!Heap_lock->owned_by_self(),
 512     "this thread should not own the Heap_lock");
 513 
 514   uint gc_count      = 0;
 515   uint full_gc_count = 0;
 516   {
 517     MutexLocker ml(Heap_lock);
 518     // This value is guarded by the Heap_lock
 519     gc_count      = total_collections();
 520     full_gc_count = total_full_collections();
 521   }
 522 




 523   VM_ParallelGCSystemGC op(gc_count, full_gc_count, cause);
 524   VMThread::execute(&op);
 525 }
 526 
 527 void ParallelScavengeHeap::object_iterate(ObjectClosure* cl) {
 528   young_gen()->object_iterate(cl);
 529   old_gen()->object_iterate(cl);
 530 }
 531 
 532 
 533 HeapWord* ParallelScavengeHeap::block_start(const void* addr) const {
 534   if (young_gen()->is_in_reserved(addr)) {
 535     assert(young_gen()->is_in(addr),
 536            "addr should be in allocated part of young gen");
 537     // called from os::print_location by find or VMError
 538     if (Debugging || VMError::fatal_error_in_progress())  return NULL;
 539     Unimplemented();
 540   } else if (old_gen()->is_in_reserved(addr)) {
 541     assert(old_gen()->is_in(addr),
 542            "addr should be in allocated part of old gen");


 565   VirtualSpaceSummary old_summary(old->reserved().start(), old_committed_end, old->reserved().end());
 566   SpaceSummary old_space(old->reserved().start(), old_committed_end, old->used_in_bytes());
 567 
 568   PSYoungGen* young = young_gen();
 569   VirtualSpaceSummary young_summary(young->reserved().start(),
 570     (HeapWord*)young->virtual_space()->committed_high_addr(), young->reserved().end());
 571 
 572   MutableSpace* eden = young_gen()->eden_space();
 573   SpaceSummary eden_space(eden->bottom(), eden->end(), eden->used_in_bytes());
 574 
 575   MutableSpace* from = young_gen()->from_space();
 576   SpaceSummary from_space(from->bottom(), from->end(), from->used_in_bytes());
 577 
 578   MutableSpace* to = young_gen()->to_space();
 579   SpaceSummary to_space(to->bottom(), to->end(), to->used_in_bytes());
 580 
 581   VirtualSpaceSummary heap_summary = create_heap_space_summary();
 582   return PSHeapSummary(heap_summary, used(), old_summary, old_space, young_summary, eden_space, from_space, to_space);
 583 }
 584 




 585 void ParallelScavengeHeap::print_on(outputStream* st) const {
 586   young_gen()->print_on(st);
 587   old_gen()->print_on(st);
 588   MetaspaceUtils::print_on(st);
 589 }
 590 
 591 void ParallelScavengeHeap::print_on_error(outputStream* st) const {
 592   this->CollectedHeap::print_on_error(st);
 593 
 594   if (UseParallelOldGC) {
 595     st->cr();
 596     PSParallelCompact::print_on_error(st);
 597   }
 598 }
 599 
 600 void ParallelScavengeHeap::gc_threads_do(ThreadClosure* tc) const {
 601   PSScavenge::gc_task_manager()->threads_do(tc);
 602 }
 603 
 604 void ParallelScavengeHeap::print_gc_threads_on(outputStream* st) const {
 605   PSScavenge::gc_task_manager()->print_threads_on(st);
 606 }
 607 
 608 void ParallelScavengeHeap::print_tracing_info() const {
 609   AdaptiveSizePolicyOutput::print();
 610   log_debug(gc, heap, exit)("Accumulated young generation GC time %3.7f secs", PSScavenge::accumulated_time()->seconds());
 611   log_debug(gc, heap, exit)("Accumulated old generation GC time %3.7f secs",
 612       UseParallelOldGC ? PSParallelCompact::accumulated_time()->seconds() : PSMarkSweepProxy::accumulated_time()->seconds());
 613 }
 614 
















































 615 
 616 void ParallelScavengeHeap::verify(VerifyOption option /* ignored */) {
 617   // Why do we need the total_collections()-filter below?
 618   if (total_collections() > 0) {
 619     log_debug(gc, verify)("Tenured");
 620     old_gen()->verify();
 621 
 622     log_debug(gc, verify)("Eden");
 623     young_gen()->verify();
 624   }
 625 }
 626 
 627 void ParallelScavengeHeap::trace_heap(GCWhen::Type when, const GCTracer* gc_tracer) {
 628   const PSHeapSummary& heap_summary = create_ps_heap_summary();
 629   gc_tracer->report_gc_heap_summary(when, heap_summary);
 630 
 631   const MetaspaceSummary& metaspace_summary = create_metaspace_summary();
 632   gc_tracer->report_metaspace_summary(when, metaspace_summary);
 633 }
 634 


< prev index next >