21 * questions. |
21 * questions. |
22 * |
22 * |
23 */ |
23 */ |
24 #include "precompiled.hpp" |
24 #include "precompiled.hpp" |
25 |
25 |
|
26 |
26 #include "memory/allocation.hpp" |
27 #include "memory/allocation.hpp" |
|
28 #include "memory/metaspace.hpp" |
|
29 #include "memory/metaspace/metaspaceEnums.hpp" |
27 #include "services/mallocTracker.hpp" |
30 #include "services/mallocTracker.hpp" |
28 #include "services/memReporter.hpp" |
31 #include "services/memReporter.hpp" |
29 #include "services/threadStackTracker.hpp" |
32 #include "services/threadStackTracker.hpp" |
30 #include "services/virtualMemoryTracker.hpp" |
33 #include "services/virtualMemoryTracker.hpp" |
31 #include "utilities/globalDefinitions.hpp" |
34 #include "utilities/globalDefinitions.hpp" |
198 amount_in_current_scale(_malloc_snapshot->malloc_overhead()->size()) > 0) { |
201 amount_in_current_scale(_malloc_snapshot->malloc_overhead()->size()) > 0) { |
199 out->print_cr("%27s (tracking overhead=" SIZE_FORMAT "%s)", " ", |
202 out->print_cr("%27s (tracking overhead=" SIZE_FORMAT "%s)", " ", |
200 amount_in_current_scale(_malloc_snapshot->malloc_overhead()->size()), scale); |
203 amount_in_current_scale(_malloc_snapshot->malloc_overhead()->size()), scale); |
201 } else if (flag == mtClass) { |
204 } else if (flag == mtClass) { |
202 // Metadata information |
205 // Metadata information |
203 report_metadata(metaspace::NonClassType); |
206 report_metadata(Metaspace::NonClassType); |
204 if (Metaspace::using_class_space()) { |
207 if (Metaspace::using_class_space()) { |
205 report_metadata(metaspace::ClassType); |
208 report_metadata(Metaspace::ClassType); |
206 } |
209 } |
207 } |
210 } |
208 out->print_cr(" "); |
211 out->print_cr(" "); |
209 } |
212 } |
210 } |
213 } |
211 |
214 |
212 void MemSummaryReporter::report_metadata(metaspace::MetadataType mdType) const { |
215 void MemSummaryReporter::report_metadata(Metaspace::MetadataType mdType) const { |
213 DEBUG_ONLY(metaspace::check_valid_mdtype(mdType)); |
216 DEBUG_ONLY(metaspace::check_valid_mdtype(mdType)); |
214 const char* const name = metaspace::describe_mdtype(mdType); |
217 const char* const name = metaspace::describe_mdtype(mdType); |
215 |
218 |
216 outputStream* out = output(); |
219 outputStream* out = output(); |
217 const char* scale = current_scale(); |
220 const char* scale = current_scale(); |
591 } |
594 } |
592 } |
595 } |
593 |
596 |
594 void MemSummaryDiffReporter::print_metaspace_diff(const MetaspaceSnapshot* current_ms, |
597 void MemSummaryDiffReporter::print_metaspace_diff(const MetaspaceSnapshot* current_ms, |
595 const MetaspaceSnapshot* early_ms) const { |
598 const MetaspaceSnapshot* early_ms) const { |
596 print_metaspace_diff(metaspace::NonClassType, current_ms, early_ms); |
599 print_metaspace_diff(Metaspace::NonClassType, current_ms, early_ms); |
597 if (Metaspace::using_class_space()) { |
600 if (Metaspace::using_class_space()) { |
598 print_metaspace_diff(metaspace::ClassType, current_ms, early_ms); |
601 print_metaspace_diff(Metaspace::ClassType, current_ms, early_ms); |
599 } |
602 } |
600 } |
603 } |
601 |
604 |
602 void MemSummaryDiffReporter::print_metaspace_diff(metaspace::MetadataType mdType, |
605 void MemSummaryDiffReporter::print_metaspace_diff(Metaspace::MetadataType mdType, |
603 const MetaspaceSnapshot* current_ms, |
606 const MetaspaceSnapshot* current_ms, |
604 const MetaspaceSnapshot* early_ms) const { |
607 const MetaspaceSnapshot* early_ms) const { |
605 DEBUG_ONLY(metaspace::check_valid_mdtype(mdType)); |
608 DEBUG_ONLY(metaspace::check_valid_mdtype(mdType)); |
606 const char* const name = metaspace::describe_mdtype(mdType); |
609 const char* const name = metaspace::describe_mdtype(mdType); |
607 |
610 |