600 return true; |
600 return true; |
601 } |
601 } |
602 |
602 |
603 // Metaspace Support |
603 // Metaspace Support |
604 MetaspaceSnapshot::MetaspaceSnapshot() { |
604 MetaspaceSnapshot::MetaspaceSnapshot() { |
605 for (int index = (int)Metaspace::ClassType; index < (int)Metaspace::MetadataTypeCount; index ++) { |
605 for (int index = (int)metaspace::ClassType; index < (int)metaspace::MetadataTypeCount; index ++) { |
606 Metaspace::MetadataType type = (Metaspace::MetadataType)index; |
606 metaspace::MetadataType type = (metaspace::MetadataType)index; |
607 assert_valid_metadata_type(type); |
607 assert_valid_metadata_type(type); |
608 _reserved_in_bytes[type] = 0; |
608 _reserved_in_bytes[type] = 0; |
609 _committed_in_bytes[type] = 0; |
609 _committed_in_bytes[type] = 0; |
610 _used_in_bytes[type] = 0; |
610 _used_in_bytes[type] = 0; |
611 _free_in_bytes[type] = 0; |
611 _free_in_bytes[type] = 0; |
612 } |
612 } |
613 } |
613 } |
614 |
614 |
615 void MetaspaceSnapshot::snapshot(Metaspace::MetadataType type, MetaspaceSnapshot& mss) { |
615 void MetaspaceSnapshot::snapshot(metaspace::MetadataType type, MetaspaceSnapshot& mss) { |
616 assert_valid_metadata_type(type); |
616 assert_valid_metadata_type(type); |
617 |
617 |
618 mss._reserved_in_bytes[type] = MetaspaceUtils::reserved_bytes(type); |
618 mss._reserved_in_bytes[type] = MetaspaceUtils::reserved_bytes(type); |
619 mss._committed_in_bytes[type] = MetaspaceUtils::committed_bytes(type); |
619 mss._committed_in_bytes[type] = MetaspaceUtils::committed_bytes(type); |
620 mss._used_in_bytes[type] = MetaspaceUtils::used_bytes(type); |
620 mss._used_in_bytes[type] = MetaspaceUtils::used_bytes(type); |
621 |
621 |
622 size_t free_in_bytes = (MetaspaceUtils::capacity_bytes(type) - MetaspaceUtils::used_bytes(type)) |
622 size_t free_in_bytes = 0;// TODO fix(MetaspaceUtils::capacity_bytes(type) - MetaspaceUtils::used_bytes(type)) |
623 + MetaspaceUtils::free_chunks_total_bytes(type) |
623 // + MetaspaceUtils::free_chunks_total_bytes(type) |
624 + MetaspaceUtils::free_in_vs_bytes(type); |
624 // + MetaspaceUtils::free_in_vs_bytes(type); |
625 mss._free_in_bytes[type] = free_in_bytes; |
625 mss._free_in_bytes[type] = free_in_bytes; |
626 } |
626 } |
627 |
627 |
628 void MetaspaceSnapshot::snapshot(MetaspaceSnapshot& mss) { |
628 void MetaspaceSnapshot::snapshot(MetaspaceSnapshot& mss) { |
629 snapshot(Metaspace::ClassType, mss); |
629 snapshot(metaspace::ClassType, mss); |
630 if (Metaspace::using_class_space()) { |
630 if (Metaspace::using_class_space()) { |
631 snapshot(Metaspace::NonClassType, mss); |
631 snapshot(metaspace::NonClassType, mss); |
632 } |
632 } |
633 } |
633 } |