< prev index next >

src/share/vm/gc/shared/collectedHeap.cpp

Print this page
rev 12504 : [mq]: whitebox
rev 12506 : [mq]: list_phases
   1 /*
   2  * Copyright (c) 2001, 2016, 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  *


 139 }
 140 
 141 void CollectedHeap::unregister_nmethod(nmethod* nm) {
 142   assert_locked_or_safepoint(CodeCache_lock);
 143 }
 144 
 145 void CollectedHeap::trace_heap(GCWhen::Type when, const GCTracer* gc_tracer) {
 146   const GCHeapSummary& heap_summary = create_heap_summary();
 147   gc_tracer->report_gc_heap_summary(when, heap_summary);
 148 
 149   const MetaspaceSummary& metaspace_summary = create_metaspace_summary();
 150   gc_tracer->report_metaspace_summary(when, metaspace_summary);
 151 }
 152 
 153 void CollectedHeap::trace_heap_before_gc(const GCTracer* gc_tracer) {
 154   trace_heap(GCWhen::BeforeGC, gc_tracer);
 155 }
 156 
 157 void CollectedHeap::trace_heap_after_gc(const GCTracer* gc_tracer) {
 158   trace_heap(GCWhen::AfterGC, gc_tracer);
















 159 }
 160 
 161 // Memory state functions.
 162 
 163 
 164 CollectedHeap::CollectedHeap() :
 165   _barrier_set(NULL),
 166   _is_gc_active(false),
 167   _total_collections(0),
 168   _total_full_collections(0),
 169   _gc_cause(GCCause::_no_gc),
 170   _gc_lastcause(GCCause::_no_gc),
 171   _defer_initial_card_mark(false) // strengthened by subclass in pre_initialize() below.
 172 {
 173   const size_t max_len = size_t(arrayOopDesc::max_array_length(T_INT));
 174   const size_t elements_per_word = HeapWordSize / sizeof(jint);
 175   _filler_array_max_size = align_object_size(filler_array_hdr_size() +
 176                                              max_len / elements_per_word);
 177 
 178   NOT_PRODUCT(_promotion_failure_alot_count = 0;)


   1 /*
   2  * Copyright (c) 2001, 2017, 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  *


 139 }
 140 
 141 void CollectedHeap::unregister_nmethod(nmethod* nm) {
 142   assert_locked_or_safepoint(CodeCache_lock);
 143 }
 144 
 145 void CollectedHeap::trace_heap(GCWhen::Type when, const GCTracer* gc_tracer) {
 146   const GCHeapSummary& heap_summary = create_heap_summary();
 147   gc_tracer->report_gc_heap_summary(when, heap_summary);
 148 
 149   const MetaspaceSummary& metaspace_summary = create_metaspace_summary();
 150   gc_tracer->report_metaspace_summary(when, metaspace_summary);
 151 }
 152 
 153 void CollectedHeap::trace_heap_before_gc(const GCTracer* gc_tracer) {
 154   trace_heap(GCWhen::BeforeGC, gc_tracer);
 155 }
 156 
 157 void CollectedHeap::trace_heap_after_gc(const GCTracer* gc_tracer) {
 158   trace_heap(GCWhen::AfterGC, gc_tracer);
 159 }
 160 
 161 // WhiteBox API support for concurrent collectors.  These are the
 162 // default implementations, for collectors which don't support this
 163 // feature.
 164 bool CollectedHeap::supports_concurrent_phase_control() const {
 165   return false;
 166 }
 167 
 168 const char* const* CollectedHeap::concurrent_phases() const {
 169   static const char* const result[] = { NULL };
 170   return result;
 171 }
 172 
 173 bool CollectedHeap::request_concurrent_phase(const char* phase) {
 174   return false;
 175 }
 176 
 177 // Memory state functions.
 178 
 179 
 180 CollectedHeap::CollectedHeap() :
 181   _barrier_set(NULL),
 182   _is_gc_active(false),
 183   _total_collections(0),
 184   _total_full_collections(0),
 185   _gc_cause(GCCause::_no_gc),
 186   _gc_lastcause(GCCause::_no_gc),
 187   _defer_initial_card_mark(false) // strengthened by subclass in pre_initialize() below.
 188 {
 189   const size_t max_len = size_t(arrayOopDesc::max_array_length(T_INT));
 190   const size_t elements_per_word = HeapWordSize / sizeof(jint);
 191   _filler_array_max_size = align_object_size(filler_array_hdr_size() +
 192                                              max_len / elements_per_word);
 193 
 194   NOT_PRODUCT(_promotion_failure_alot_count = 0;)


< prev index next >