< prev index next >

src/hotspot/share/memory/metaspace/metaspaceReporter.cpp

Print this page

 21  * or visit www.oracle.com if you need additional information or have any
 22  * questions.
 23  *
 24  */
 25 
 26 #include "precompiled.hpp"
 27 #include "classfile/classLoaderData.hpp"
 28 #include "classfile/classLoaderDataGraph.hpp"
 29 #include "memory/metaspace.hpp"
 30 #include "memory/metaspace/chunkHeaderPool.hpp"
 31 #include "memory/metaspace/chunkManager.hpp"
 32 #include "memory/metaspace/internalStats.hpp"
 33 #include "memory/metaspace/metaspaceCommon.hpp"
 34 #include "memory/metaspace/metaspaceReporter.hpp"
 35 #include "memory/metaspace/metaspaceSettings.hpp"
 36 #include "memory/metaspace/metaspaceStatistics.hpp"
 37 #include "memory/metaspace/printCLDMetaspaceInfoClosure.hpp"
 38 #include "memory/metaspace/runningCounters.hpp"
 39 #include "memory/metaspace/virtualSpaceList.hpp"
 40 #include "memory/metaspaceUtils.hpp"

 41 #include "runtime/os.hpp"
 42 
 43 namespace metaspace {
 44 
 45 static const char* describe_spacetype(Metaspace::MetaspaceType st) {
 46   const char* s = NULL;
 47   switch (st) {
 48     case Metaspace::StandardMetaspaceType: s = "Standard"; break;
 49     case Metaspace::BootMetaspaceType: s = "Boot"; break;
 50     case Metaspace::ClassMirrorHolderMetaspaceType: s = "ClassMirrorHolder"; break;
 51     case Metaspace::ReflectionMetaspaceType: s = "Reflection"; break;
 52     default: ShouldNotReachHere();
 53   }
 54   return s;
 55 }
 56 
 57 static void print_vs(outputStream* out, size_t scale) {
 58   const size_t reserved_nc = RunningCounters::reserved_words_nonclass();
 59   const size_t committed_nc = RunningCounters::committed_words_nonclass();
 60   const int num_nodes_nc = VirtualSpaceList::vslist_nonclass()->num_nodes();

 88     print_scaled_words(out, reserved_nc, scale, 7);
 89     out->print(" reserved, ");
 90     print_scaled_words_and_percentage(out, committed_nc, reserved_nc, scale, 7);
 91     out->print(" committed, ");
 92     out->print(" %d nodes.", num_nodes_nc);
 93     out->cr();
 94   }
 95 }
 96 
 97 static void print_settings(outputStream* out, size_t scale) {
 98   out->print("MaxMetaspaceSize: ");
 99   if (MaxMetaspaceSize == max_uintx) {
100     out->print("unlimited");
101   } else {
102     print_human_readable_size(out, MaxMetaspaceSize, scale);
103   }
104   out->cr();
105   if (Metaspace::using_class_space()) {
106     out->print("CompressedClassSpaceSize: ");
107     print_human_readable_size(out, CompressedClassSpaceSize, scale);






108   } else {
109     out->print("No class space");
110   }
111   out->cr();
112   out->print("Initial GC threshold: ");
113   print_human_readable_size(out, MetaspaceSize, scale);
114   out->cr();
115   out->print("Current GC threshold: ");
116   print_human_readable_size(out, MetaspaceGC::capacity_until_GC(), scale);
117   out->cr();
118   out->print_cr("CDS: %s", (UseSharedSpaces ? "on" : (DumpSharedSpaces ? "dump" : "off")));
119   out->print_cr("MetaspaceReclaimPolicy: %s", MetaspaceReclaimPolicy);
120   Settings::print_on(out);
121 }
122 
123 // This will print out a basic metaspace usage report but
124 // unlike print_report() is guaranteed not to lock or to walk the CLDG.
125 void MetaspaceReporter::print_basic_report(outputStream* out, size_t scale) {
126   if (!Metaspace::initialized()) {
127     out->print_cr("Metaspace not yet initialized.");
128     return;
129   }
130   out->cr();
131   out->print_cr("Usage:");

 21  * or visit www.oracle.com if you need additional information or have any
 22  * questions.
 23  *
 24  */
 25 
 26 #include "precompiled.hpp"
 27 #include "classfile/classLoaderData.hpp"
 28 #include "classfile/classLoaderDataGraph.hpp"
 29 #include "memory/metaspace.hpp"
 30 #include "memory/metaspace/chunkHeaderPool.hpp"
 31 #include "memory/metaspace/chunkManager.hpp"
 32 #include "memory/metaspace/internalStats.hpp"
 33 #include "memory/metaspace/metaspaceCommon.hpp"
 34 #include "memory/metaspace/metaspaceReporter.hpp"
 35 #include "memory/metaspace/metaspaceSettings.hpp"
 36 #include "memory/metaspace/metaspaceStatistics.hpp"
 37 #include "memory/metaspace/printCLDMetaspaceInfoClosure.hpp"
 38 #include "memory/metaspace/runningCounters.hpp"
 39 #include "memory/metaspace/virtualSpaceList.hpp"
 40 #include "memory/metaspaceUtils.hpp"
 41 #include "oops/compressedOops.hpp"
 42 #include "runtime/os.hpp"
 43 
 44 namespace metaspace {
 45 
 46 static const char* describe_spacetype(Metaspace::MetaspaceType st) {
 47   const char* s = NULL;
 48   switch (st) {
 49     case Metaspace::StandardMetaspaceType: s = "Standard"; break;
 50     case Metaspace::BootMetaspaceType: s = "Boot"; break;
 51     case Metaspace::ClassMirrorHolderMetaspaceType: s = "ClassMirrorHolder"; break;
 52     case Metaspace::ReflectionMetaspaceType: s = "Reflection"; break;
 53     default: ShouldNotReachHere();
 54   }
 55   return s;
 56 }
 57 
 58 static void print_vs(outputStream* out, size_t scale) {
 59   const size_t reserved_nc = RunningCounters::reserved_words_nonclass();
 60   const size_t committed_nc = RunningCounters::committed_words_nonclass();
 61   const int num_nodes_nc = VirtualSpaceList::vslist_nonclass()->num_nodes();

 89     print_scaled_words(out, reserved_nc, scale, 7);
 90     out->print(" reserved, ");
 91     print_scaled_words_and_percentage(out, committed_nc, reserved_nc, scale, 7);
 92     out->print(" committed, ");
 93     out->print(" %d nodes.", num_nodes_nc);
 94     out->cr();
 95   }
 96 }
 97 
 98 static void print_settings(outputStream* out, size_t scale) {
 99   out->print("MaxMetaspaceSize: ");
100   if (MaxMetaspaceSize == max_uintx) {
101     out->print("unlimited");
102   } else {
103     print_human_readable_size(out, MaxMetaspaceSize, scale);
104   }
105   out->cr();
106   if (Metaspace::using_class_space()) {
107     out->print("CompressedClassSpaceSize: ");
108     print_human_readable_size(out, CompressedClassSpaceSize, scale);
109     out->cr();
110     out->print_cr("KlassAlignmentInBytes: %d", KlassAlignmentInBytes);
111     out->print("KlassEncodingMetaspaceMax: ");
112     print_human_readable_size(out, KlassEncodingMetaspaceMax, scale);
113     out->cr();
114     CompressedKlassPointers::print_mode(out);
115   } else {
116     out->print_cr("No class space");
117   }

118   out->print("Initial GC threshold: ");
119   print_human_readable_size(out, MetaspaceSize, scale);
120   out->cr();
121   out->print("Current GC threshold: ");
122   print_human_readable_size(out, MetaspaceGC::capacity_until_GC(), scale);
123   out->cr();
124   out->print_cr("CDS: %s", (UseSharedSpaces ? "on" : (DumpSharedSpaces ? "dump" : "off")));
125   out->print_cr("MetaspaceReclaimPolicy: %s", MetaspaceReclaimPolicy);
126   Settings::print_on(out);
127 }
128 
129 // This will print out a basic metaspace usage report but
130 // unlike print_report() is guaranteed not to lock or to walk the CLDG.
131 void MetaspaceReporter::print_basic_report(outputStream* out, size_t scale) {
132   if (!Metaspace::initialized()) {
133     out->print_cr("Metaspace not yet initialized.");
134     return;
135   }
136   out->cr();
137   out->print_cr("Usage:");
< prev index next >