< prev index next >

src/share/vm/memory/metaspaceShared.cpp

Print this page

        

*** 34,43 **** --- 34,45 ---- #include "classfile/systemDictionaryShared.hpp" #include "code/codeCache.hpp" #include "gc/shared/gcLocker.hpp" #include "interpreter/bytecodeStream.hpp" #include "interpreter/bytecodes.hpp" + #include "logging/log.hpp" + #include "logging/logMessage.hpp" #include "memory/filemap.hpp" #include "memory/metaspace.hpp" #include "memory/metaspaceShared.hpp" #include "memory/resourceArea.hpp" #include "oops/instanceClassLoaderKlass.hpp"
*** 328,340 **** intptr_t* srcvtable = vtable_of(tmp); intptr_t* dstvtable = info->cloned_vtable(); // We already checked (and, if necessary, adjusted n) when the vtables were allocated, so we are // safe to do memcpy. ! if (PrintSharedSpaces) { ! tty->print_cr("Copying %3d vtable entries for %s", n, name); ! } memcpy(dstvtable, srcvtable, sizeof(intptr_t) * n); return dstvtable + n; } // To determine the size of the vtable for each type, we use the following --- 330,340 ---- intptr_t* srcvtable = vtable_of(tmp); intptr_t* dstvtable = info->cloned_vtable(); // We already checked (and, if necessary, adjusted n) when the vtables were allocated, so we are // safe to do memcpy. ! log_debug(cds, vtables)("Copying %3d vtable entries for %s", n, name); memcpy(dstvtable, srcvtable, sizeof(intptr_t) * n); return dstvtable + n; } // To determine the size of the vtable for each type, we use the following
*** 381,393 **** for (; ; vtable_len++) { if (avtable[vtable_len] != bvtable[vtable_len]) { break; } } ! if (PrintSharedSpaces) { ! tty->print_cr("Found %3d vtable entries for %s", vtable_len, name); ! } return vtable_len; } #define ALLOC_CPP_VTABLE_CLONE(c) \ --- 381,391 ---- for (; ; vtable_len++) { if (avtable[vtable_len] != bvtable[vtable_len]) { break; } } ! log_debug(cds, vtables)("Found %3d vtable entries for %s", vtable_len, name); return vtable_len; } #define ALLOC_CPP_VTABLE_CLONE(c) \
*** 626,638 **** // To make fmt_stats be a syntactic constant (for format warnings), use #define. #define fmt_stats "%-20s: %8d %10d %5.1f | %8d %10d %5.1f | %8d %10d %5.1f" const char *sep = "--------------------+---------------------------+---------------------------+--------------------------"; const char *hdr = " ro_cnt ro_bytes % | rw_cnt rw_bytes % | all_cnt all_bytes %"; ! tty->print_cr("Detailed metadata info (rw includes md and mc):"); ! tty->print_cr("%s", hdr); ! tty->print_cr("%s", sep); for (int type = 0; type < int(_number_of_types); type ++) { const char *name = type_name((Type)type); int ro_count = _counts[RO][type]; int ro_bytes = _bytes [RO][type]; int rw_count = _counts[RW][type]; --- 624,640 ---- // To make fmt_stats be a syntactic constant (for format warnings), use #define. #define fmt_stats "%-20s: %8d %10d %5.1f | %8d %10d %5.1f | %8d %10d %5.1f" const char *sep = "--------------------+---------------------------+---------------------------+--------------------------"; const char *hdr = " ro_cnt ro_bytes % | rw_cnt rw_bytes % | all_cnt all_bytes %"; ! ResourceMark rm; ! LogMessage(cds) msg; ! stringStream info_stream; ! ! info_stream.print_cr("Detailed metadata info (rw includes md and mc):"); ! info_stream.print_cr("%s", hdr); ! info_stream.print_cr("%s", sep); for (int type = 0; type < int(_number_of_types); type ++) { const char *name = type_name((Type)type); int ro_count = _counts[RO][type]; int ro_bytes = _bytes [RO][type]; int rw_count = _counts[RW][type];
*** 642,652 **** double ro_perc = 100.0 * double(ro_bytes) / double(ro_all); double rw_perc = 100.0 * double(rw_bytes) / double(rw_all); double perc = 100.0 * double(bytes) / double(ro_all + rw_all); ! tty->print_cr(fmt_stats, name, ro_count, ro_bytes, ro_perc, rw_count, rw_bytes, rw_perc, count, bytes, perc); all_ro_count += ro_count; --- 644,654 ---- double ro_perc = 100.0 * double(ro_bytes) / double(ro_all); double rw_perc = 100.0 * double(rw_bytes) / double(rw_all); double perc = 100.0 * double(bytes) / double(ro_all + rw_all); ! info_stream.print_cr(fmt_stats, name, ro_count, ro_bytes, ro_perc, rw_count, rw_bytes, rw_perc, count, bytes, perc); all_ro_count += ro_count;
*** 660,677 **** double all_ro_perc = 100.0 * double(all_ro_bytes) / double(ro_all); double all_rw_perc = 100.0 * double(all_rw_bytes) / double(rw_all); double all_perc = 100.0 * double(all_bytes) / double(ro_all + rw_all); ! tty->print_cr("%s", sep); ! tty->print_cr(fmt_stats, "Total", all_ro_count, all_ro_bytes, all_ro_perc, all_rw_count, all_rw_bytes, all_rw_perc, all_count, all_bytes, all_perc); assert(all_ro_bytes == ro_all, "everything should have been counted"); assert(all_rw_bytes == rw_all, "everything should have been counted"); #undef fmt_stats } // Populate the shared space. --- 662,681 ---- double all_ro_perc = 100.0 * double(all_ro_bytes) / double(ro_all); double all_rw_perc = 100.0 * double(all_rw_bytes) / double(rw_all); double all_perc = 100.0 * double(all_bytes) / double(ro_all + rw_all); ! info_stream.print_cr("%s", sep); ! info_stream.print_cr(fmt_stats, "Total", all_ro_count, all_ro_bytes, all_ro_perc, all_rw_count, all_rw_bytes, all_rw_perc, all_count, all_bytes, all_perc); assert(all_ro_bytes == ro_all, "everything should have been counted"); assert(all_rw_bytes == rw_all, "everything should have been counted"); + + msg.info("%s", info_stream.as_string()); #undef fmt_stats } // Populate the shared space.
*** 895,905 **** mapinfo->close(); // Restore the vtable in case we invoke any virtual methods. MetaspaceShared::clone_cpp_vtables((intptr_t*)vtbl_list); ! if (PrintSharedSpaces) { DumpAllocClosure dac; dac.iterate_metaspace(_loader_data->ro_metaspace(), DumpAllocClosure::RO); dac.iterate_metaspace(_loader_data->rw_metaspace(), DumpAllocClosure::RW); dac.dump_stats(int(ro_bytes), int(rw_bytes), int(md_bytes), int(mc_bytes)); --- 899,909 ---- mapinfo->close(); // Restore the vtable in case we invoke any virtual methods. MetaspaceShared::clone_cpp_vtables((intptr_t*)vtbl_list); ! if (log_is_enabled(Info, cds)) { DumpAllocClosure dac; dac.iterate_metaspace(_loader_data->ro_metaspace(), DumpAllocClosure::RO); dac.iterate_metaspace(_loader_data->rw_metaspace(), DumpAllocClosure::RW); dac.dump_stats(int(ro_bytes), int(rw_bytes), int(md_bytes), int(mc_bytes));
*** 1062,1074 **** class_count += preload_and_dump(ExtraSharedClassListFile, class_promote_order, THREAD); } tty->print_cr("Loading classes to share: done."); ! if (PrintSharedSpaces) { ! tty->print_cr("Shared spaces: preloaded %d classes", class_count); ! } // Rewrite and link classes tty->print_cr("Rewriting and linking classes ..."); // Link any classes which got missed. This would happen if we have loaded classes that --- 1066,1076 ---- class_count += preload_and_dump(ExtraSharedClassListFile, class_promote_order, THREAD); } tty->print_cr("Loading classes to share: done."); ! log_info(cds)("Shared spaces: preloaded %d classes", class_count); // Rewrite and link classes tty->print_cr("Rewriting and linking classes ..."); // Link any classes which got missed. This would happen if we have loaded classes that
*** 1100,1112 **** while (parser.parse_one_line()) { Klass* klass = ClassLoaderExt::load_one_class(&parser, THREAD); CLEAR_PENDING_EXCEPTION; if (klass != NULL) { ! if (PrintSharedSpaces && Verbose && WizardMode) { ResourceMark rm; ! tty->print_cr("Shared spaces preloaded: %s", klass->external_name()); } InstanceKlass* ik = InstanceKlass::cast(klass); // Should be class load order as per -Xlog:class+preorder --- 1102,1114 ---- while (parser.parse_one_line()) { Klass* klass = ClassLoaderExt::load_one_class(&parser, THREAD); CLEAR_PENDING_EXCEPTION; if (klass != NULL) { ! if (log_is_enabled(Trace, cds)) { ResourceMark rm; ! log_trace(cds)("Shared spaces preloaded: %s", klass->external_name()); } InstanceKlass* ik = InstanceKlass::cast(klass); // Should be class load order as per -Xlog:class+preorder
< prev index next >