< prev index next >

src/hotspot/share/services/virtualMemoryTracker.cpp

Print this page
rev 49171 : imported patch 8185034-metaspace-cleanup-1-rename-metaspaceaux


 545   }
 546 
 547   return true;
 548 }
 549 
 550 // Metaspace Support
 551 MetaspaceSnapshot::MetaspaceSnapshot() {
 552   for (int index = (int)Metaspace::ClassType; index < (int)Metaspace::MetadataTypeCount; index ++) {
 553     Metaspace::MetadataType type = (Metaspace::MetadataType)index;
 554     assert_valid_metadata_type(type);
 555     _reserved_in_bytes[type]  = 0;
 556     _committed_in_bytes[type] = 0;
 557     _used_in_bytes[type]      = 0;
 558     _free_in_bytes[type]      = 0;
 559   }
 560 }
 561 
 562 void MetaspaceSnapshot::snapshot(Metaspace::MetadataType type, MetaspaceSnapshot& mss) {
 563   assert_valid_metadata_type(type);
 564 
 565   mss._reserved_in_bytes[type]   = MetaspaceAux::reserved_bytes(type);
 566   mss._committed_in_bytes[type]  = MetaspaceAux::committed_bytes(type);
 567   mss._used_in_bytes[type]       = MetaspaceAux::used_bytes(type);
 568 
 569   size_t free_in_bytes = (MetaspaceAux::capacity_bytes(type) - MetaspaceAux::used_bytes(type))
 570                        + MetaspaceAux::free_chunks_total_bytes(type)
 571                        + MetaspaceAux::free_bytes(type);
 572   mss._free_in_bytes[type] = free_in_bytes;
 573 }
 574 
 575 void MetaspaceSnapshot::snapshot(MetaspaceSnapshot& mss) {
 576   snapshot(Metaspace::ClassType, mss);
 577   if (Metaspace::using_class_space()) {
 578     snapshot(Metaspace::NonClassType, mss);
 579   }
 580 }


 545   }
 546 
 547   return true;
 548 }
 549 
 550 // Metaspace Support
 551 MetaspaceSnapshot::MetaspaceSnapshot() {
 552   for (int index = (int)Metaspace::ClassType; index < (int)Metaspace::MetadataTypeCount; index ++) {
 553     Metaspace::MetadataType type = (Metaspace::MetadataType)index;
 554     assert_valid_metadata_type(type);
 555     _reserved_in_bytes[type]  = 0;
 556     _committed_in_bytes[type] = 0;
 557     _used_in_bytes[type]      = 0;
 558     _free_in_bytes[type]      = 0;
 559   }
 560 }
 561 
 562 void MetaspaceSnapshot::snapshot(Metaspace::MetadataType type, MetaspaceSnapshot& mss) {
 563   assert_valid_metadata_type(type);
 564 
 565   mss._reserved_in_bytes[type]   = MetaspaceUtils::reserved_bytes(type);
 566   mss._committed_in_bytes[type]  = MetaspaceUtils::committed_bytes(type);
 567   mss._used_in_bytes[type]       = MetaspaceUtils::used_bytes(type);
 568 
 569   size_t free_in_bytes = (MetaspaceUtils::capacity_bytes(type) - MetaspaceUtils::used_bytes(type))
 570                        + MetaspaceUtils::free_chunks_total_bytes(type)
 571                        + MetaspaceUtils::free_bytes(type);
 572   mss._free_in_bytes[type] = free_in_bytes;
 573 }
 574 
 575 void MetaspaceSnapshot::snapshot(MetaspaceSnapshot& mss) {
 576   snapshot(Metaspace::ClassType, mss);
 577   if (Metaspace::using_class_space()) {
 578     snapshot(Metaspace::NonClassType, mss);
 579   }
 580 }
< prev index next >