< prev index next >

src/hotspot/share/memory/metaspace.cpp

Print this page




 599   }
 600   out->cr();
 601 
 602 }
 603 
 604 void MetaspaceUtils::print_report(outputStream* out, size_t scale, int flags) {
 605 
 606   const bool print_loaders = (flags & rf_show_loaders) > 0;
 607   const bool print_classes = (flags & rf_show_classes) > 0;
 608   const bool print_by_chunktype = (flags & rf_break_down_by_chunktype) > 0;
 609   const bool print_by_spacetype = (flags & rf_break_down_by_spacetype) > 0;
 610 
 611   // Some report options require walking the class loader data graph.
 612   PrintCLDMetaspaceInfoClosure cl(out, scale, print_loaders, print_classes, print_by_chunktype);
 613   if (print_loaders) {
 614     out->cr();
 615     out->print_cr("Usage per loader:");
 616     out->cr();
 617   }
 618 
 619   ClassLoaderDataGraph::cld_do(&cl); // collect data and optionally print
 620 
 621   // Print totals, broken up by space type.
 622   if (print_by_spacetype) {
 623     out->cr();
 624     out->print_cr("Usage per space type:");
 625     out->cr();
 626     for (int space_type = (int)Metaspace::ZeroMetaspaceType;
 627          space_type < (int)Metaspace::MetaspaceTypeCount; space_type ++)
 628     {
 629       uintx num = cl._num_loaders_by_spacetype[space_type];
 630       out->print("%s (" UINTX_FORMAT " loader%s)%c",
 631         space_type_name((Metaspace::MetaspaceType)space_type),
 632         num, (num == 1 ? "" : "s"), (num > 0 ? ':' : '.'));
 633       if (num > 0) {
 634         cl._stats_by_spacetype[space_type].print_on(out, scale, print_by_chunktype);
 635       }
 636       out->cr();
 637     }
 638   }
 639 




 599   }
 600   out->cr();
 601 
 602 }
 603 
 604 void MetaspaceUtils::print_report(outputStream* out, size_t scale, int flags) {
 605 
 606   const bool print_loaders = (flags & rf_show_loaders) > 0;
 607   const bool print_classes = (flags & rf_show_classes) > 0;
 608   const bool print_by_chunktype = (flags & rf_break_down_by_chunktype) > 0;
 609   const bool print_by_spacetype = (flags & rf_break_down_by_spacetype) > 0;
 610 
 611   // Some report options require walking the class loader data graph.
 612   PrintCLDMetaspaceInfoClosure cl(out, scale, print_loaders, print_classes, print_by_chunktype);
 613   if (print_loaders) {
 614     out->cr();
 615     out->print_cr("Usage per loader:");
 616     out->cr();
 617   }
 618 
 619   ClassLoaderDataGraph::loaded_cld_do(&cl); // collect data and optionally print
 620 
 621   // Print totals, broken up by space type.
 622   if (print_by_spacetype) {
 623     out->cr();
 624     out->print_cr("Usage per space type:");
 625     out->cr();
 626     for (int space_type = (int)Metaspace::ZeroMetaspaceType;
 627          space_type < (int)Metaspace::MetaspaceTypeCount; space_type ++)
 628     {
 629       uintx num = cl._num_loaders_by_spacetype[space_type];
 630       out->print("%s (" UINTX_FORMAT " loader%s)%c",
 631         space_type_name((Metaspace::MetaspaceType)space_type),
 632         num, (num == 1 ? "" : "s"), (num > 0 ? ':' : '.'));
 633       if (num > 0) {
 634         cl._stats_by_spacetype[space_type].print_on(out, scale, print_by_chunktype);
 635       }
 636       out->cr();
 637     }
 638   }
 639 


< prev index next >