< prev index next >

src/hotspot/share/services/virtualMemoryTracker.cpp

Print this page
rev 60538 : imported patch jep387-misc.patch


 650 
 651 // Metaspace Support
 652 MetaspaceSnapshot::MetaspaceSnapshot() {
 653   for (int index = (int)Metaspace::ClassType; index < (int)Metaspace::MetadataTypeCount; index ++) {
 654     Metaspace::MetadataType type = (Metaspace::MetadataType)index;
 655     assert_valid_metadata_type(type);
 656     _reserved_in_bytes[type]  = 0;
 657     _committed_in_bytes[type] = 0;
 658     _used_in_bytes[type]      = 0;
 659     _free_in_bytes[type]      = 0;
 660   }
 661 }
 662 
 663 void MetaspaceSnapshot::snapshot(Metaspace::MetadataType type, MetaspaceSnapshot& mss) {
 664   assert_valid_metadata_type(type);
 665 
 666   mss._reserved_in_bytes[type]   = MetaspaceUtils::reserved_bytes(type);
 667   mss._committed_in_bytes[type]  = MetaspaceUtils::committed_bytes(type);
 668   mss._used_in_bytes[type]       = MetaspaceUtils::used_bytes(type);
 669 
 670   size_t free_in_bytes = (MetaspaceUtils::capacity_bytes(type) - MetaspaceUtils::used_bytes(type))
 671                        + MetaspaceUtils::free_chunks_total_bytes(type)
 672                        + MetaspaceUtils::free_in_vs_bytes(type);
 673   mss._free_in_bytes[type] = free_in_bytes;
 674 }
 675 
 676 void MetaspaceSnapshot::snapshot(MetaspaceSnapshot& mss) {
 677   snapshot(Metaspace::ClassType, mss);
 678   if (Metaspace::using_class_space()) {
 679     snapshot(Metaspace::NonClassType, mss);
 680   }
 681 }


 650 
 651 // Metaspace Support
 652 MetaspaceSnapshot::MetaspaceSnapshot() {
 653   for (int index = (int)Metaspace::ClassType; index < (int)Metaspace::MetadataTypeCount; index ++) {
 654     Metaspace::MetadataType type = (Metaspace::MetadataType)index;
 655     assert_valid_metadata_type(type);
 656     _reserved_in_bytes[type]  = 0;
 657     _committed_in_bytes[type] = 0;
 658     _used_in_bytes[type]      = 0;
 659     _free_in_bytes[type]      = 0;
 660   }
 661 }
 662 
 663 void MetaspaceSnapshot::snapshot(Metaspace::MetadataType type, MetaspaceSnapshot& mss) {
 664   assert_valid_metadata_type(type);
 665 
 666   mss._reserved_in_bytes[type]   = MetaspaceUtils::reserved_bytes(type);
 667   mss._committed_in_bytes[type]  = MetaspaceUtils::committed_bytes(type);
 668   mss._used_in_bytes[type]       = MetaspaceUtils::used_bytes(type);
 669 
 670   size_t free_in_bytes = 0;// TODO fix(MetaspaceUtils::capacity_bytes(type) - MetaspaceUtils::used_bytes(type))
 671                      //  + MetaspaceUtils::free_chunks_total_bytes(type)
 672                      //  + MetaspaceUtils::free_in_vs_bytes(type);
 673   mss._free_in_bytes[type] = free_in_bytes;
 674 }
 675 
 676 void MetaspaceSnapshot::snapshot(MetaspaceSnapshot& mss) {
 677   snapshot(Metaspace::ClassType, mss);
 678   if (Metaspace::using_class_space()) {
 679     snapshot(Metaspace::NonClassType, mss);
 680   }
 681 }
< prev index next >