< prev index next >

src/share/vm/memory/universe.cpp

Print this page

        

*** 34,45 **** --- 34,47 ---- #include "gc/shared/cardTableModRefBS.hpp" #include "gc/shared/collectedHeap.inline.hpp" #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/generation.hpp" + #include "gc/shared/gcTraceTime.hpp" #include "gc/shared/space.hpp" #include "interpreter/interpreter.hpp" + #include "logging/log.hpp" #include "memory/filemap.hpp" #include "memory/metadataFactory.hpp" #include "memory/metaspaceShared.hpp" #include "memory/oopFactory.hpp" #include "memory/universe.hpp"
*** 70,79 **** --- 72,82 ---- #include "services/memoryService.hpp" #include "utilities/copy.hpp" #include "utilities/events.hpp" #include "utilities/hashtable.inline.hpp" #include "utilities/macros.hpp" + #include "utilities/ostream.hpp" #include "utilities/preserveException.hpp" #if INCLUDE_ALL_GCS #include "gc/cms/cmsCollectorPolicy.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp"
*** 516,526 **** void Universe::run_finalizers_on_exit() { if (has_run_finalizers_on_exit) return; has_run_finalizers_on_exit = true; // Called on VM exit. This ought to be run in a separate thread. ! if (TraceReferenceGC) tty->print_cr("Callback to run finalizers on exit"); { PRESERVE_EXCEPTION_MARK; KlassHandle finalizer_klass(THREAD, SystemDictionary::Finalizer_klass()); JavaValue result(T_VOID); JavaCalls::call_static( --- 519,529 ---- void Universe::run_finalizers_on_exit() { if (has_run_finalizers_on_exit) return; has_run_finalizers_on_exit = true; // Called on VM exit. This ought to be run in a separate thread. ! log_trace(ref)("Callback to run finalizers on exit"); { PRESERVE_EXCEPTION_MARK; KlassHandle finalizer_klass(THREAD, SystemDictionary::Finalizer_klass()); JavaValue result(T_VOID); JavaCalls::call_static(
*** 739,748 **** --- 742,752 ---- status = _collectedHeap->initialize(); if (status != JNI_OK) { return status; } + log_info(gc)("Using %s", _collectedHeap->name()); ThreadLocalAllocBuffer::set_max_size(Universe::heap()->max_tlab_size()); #ifdef _LP64 if (UseCompressedOops) {
*** 1074,1095 **** void Universe::compute_base_vtable_size() { _base_vtable_size = ClassLoader::compute_Object_vtable(); } ! ! void Universe::print() { ! print_on(gclog_or_tty); ! } ! ! void Universe::print_on(outputStream* st, bool extended) { st->print_cr("Heap"); - if (!extended) { heap()->print_on(st); - } else { - heap()->print_extended_on(st); - } } void Universe::print_heap_at_SIGBREAK() { if (PrintHeapAtSIGBREAK) { MutexLocker hl(Heap_lock); --- 1078,1090 ---- void Universe::compute_base_vtable_size() { _base_vtable_size = ClassLoader::compute_Object_vtable(); } ! void Universe::print_on(outputStream* st) { st->print_cr("Heap"); heap()->print_on(st); } void Universe::print_heap_at_SIGBREAK() { if (PrintHeapAtSIGBREAK) { MutexLocker hl(Heap_lock);
*** 1097,1130 **** tty->cr(); tty->flush(); } } ! void Universe::print_heap_before_gc(outputStream* st, bool ignore_extended) { ! st->print_cr("{Heap before GC invocations=%u (full %u):", ! heap()->total_collections(), ! heap()->total_full_collections()); ! if (!PrintHeapAtGCExtended || ignore_extended) { ! heap()->print_on(st); ! } else { ! heap()->print_extended_on(st); } } ! void Universe::print_heap_after_gc(outputStream* st, bool ignore_extended) { ! st->print_cr("Heap after GC invocations=%u (full %u):", ! heap()->total_collections(), ! heap()->total_full_collections()); ! if (!PrintHeapAtGCExtended || ignore_extended) { ! heap()->print_on(st); ! } else { ! heap()->print_extended_on(st); } - st->print_cr("}"); } ! void Universe::verify(VerifyOption option, const char* prefix, bool silent) { // The use of _verify_in_progress is a temporary work around for // 6320749. Don't bother with a creating a class to set and clear // it since it is only used in this method and the control flow is // straight forward. _verify_in_progress = true; --- 1092,1120 ---- tty->cr(); tty->flush(); } } ! void Universe::print_heap_before_gc() { ! LogHandle(gc, heap) log; ! if (log.is_trace()) { ! log.trace("Heap before GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections()); ! ResourceMark rm; ! heap()->print_on(log.trace_stream()); } } ! void Universe::print_heap_after_gc() { ! LogHandle(gc, heap) log; ! if (log.is_trace()) { ! log.trace("Heap after GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections()); ! ResourceMark rm; ! heap()->print_on(log.trace_stream()); } } ! void Universe::verify(VerifyOption option, const char* prefix) { // The use of _verify_in_progress is a temporary work around for // 6320749. Don't bother with a creating a class to set and clear // it since it is only used in this method and the control flow is // straight forward. _verify_in_progress = true;
*** 1137,1176 **** ResourceMark rm; HandleMark hm; // Handles created during verification can be zapped _verify_count++; ! if (!silent) gclog_or_tty->print("%s", prefix); ! if (!silent) gclog_or_tty->print("[Verifying "); ! if (!silent) gclog_or_tty->print("threads "); Threads::verify(); ! if (!silent) gclog_or_tty->print("heap "); ! heap()->verify(silent, option); ! if (!silent) gclog_or_tty->print("syms "); SymbolTable::verify(); ! if (!silent) gclog_or_tty->print("strs "); StringTable::verify(); { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); ! if (!silent) gclog_or_tty->print("zone "); CodeCache::verify(); } ! if (!silent) gclog_or_tty->print("dict "); SystemDictionary::verify(); #ifndef PRODUCT ! if (!silent) gclog_or_tty->print("cldg "); ClassLoaderDataGraph::verify(); #endif ! if (!silent) gclog_or_tty->print("metaspace chunks "); MetaspaceAux::verify_free_chunks(); ! if (!silent) gclog_or_tty->print("hand "); JNIHandles::verify(); ! if (!silent) gclog_or_tty->print("C-heap "); os::check_heap(); ! if (!silent) gclog_or_tty->print("code cache "); CodeCache::verify_oops(); - if (!silent) gclog_or_tty->print_cr("]"); _verify_in_progress = false; } --- 1127,1165 ---- ResourceMark rm; HandleMark hm; // Handles created during verification can be zapped _verify_count++; ! FormatBuffer<> title("Verifying %s", prefix); ! GCTraceTime(Info, gc, verify) tm(title.buffer()); ! log_debug(gc, verify)("Threads"); Threads::verify(); ! log_debug(gc, verify)("Heap"); ! heap()->verify(option); ! log_debug(gc, verify)("SymbolTable"); SymbolTable::verify(); ! log_debug(gc, verify)("StringTable"); StringTable::verify(); { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); ! log_debug(gc, verify)("CodeCache"); CodeCache::verify(); } ! log_debug(gc, verify)("SystemDictionary"); SystemDictionary::verify(); #ifndef PRODUCT ! log_debug(gc, verify)("ClassLoaderDataGraph"); ClassLoaderDataGraph::verify(); #endif ! log_debug(gc, verify)("MetaspaceAux"); MetaspaceAux::verify_free_chunks(); ! log_debug(gc, verify)("JNIHandles"); JNIHandles::verify(); ! log_debug(gc, verify)("C-heap"); os::check_heap(); ! log_debug(gc, verify)("CodeCache Oops"); CodeCache::verify_oops(); _verify_in_progress = false; }
< prev index next >