499 MetaspaceSnapshot::MetaspaceSnapshot() {
500 for (int index = (int)Metaspace::ClassType; index < (int)Metaspace::MetadataTypeCount; index ++) {
501 Metaspace::MetadataType type = (Metaspace::MetadataType)index;
502 assert_valid_metadata_type(type);
503 _reserved_in_bytes[type] = 0;
504 _committed_in_bytes[type] = 0;
505 _used_in_bytes[type] = 0;
506 _free_in_bytes[type] = 0;
507 }
508 }
509
510 void MetaspaceSnapshot::snapshot(Metaspace::MetadataType type, MetaspaceSnapshot& mss) {
511 assert_valid_metadata_type(type);
512
513 mss._reserved_in_bytes[type] = MetaspaceUtils::reserved_bytes(type);
514 mss._committed_in_bytes[type] = MetaspaceUtils::committed_bytes(type);
515 mss._used_in_bytes[type] = MetaspaceUtils::used_bytes(type);
516
517 size_t free_in_bytes = (MetaspaceUtils::capacity_bytes(type) - MetaspaceUtils::used_bytes(type))
518 + MetaspaceUtils::free_chunks_total_bytes(type)
519 + MetaspaceUtils::free_bytes(type);
520 mss._free_in_bytes[type] = free_in_bytes;
521 }
522
523 void MetaspaceSnapshot::snapshot(MetaspaceSnapshot& mss) {
524 snapshot(Metaspace::ClassType, mss);
525 if (Metaspace::using_class_space()) {
526 snapshot(Metaspace::NonClassType, mss);
527 }
528 }
|
499 MetaspaceSnapshot::MetaspaceSnapshot() {
500 for (int index = (int)Metaspace::ClassType; index < (int)Metaspace::MetadataTypeCount; index ++) {
501 Metaspace::MetadataType type = (Metaspace::MetadataType)index;
502 assert_valid_metadata_type(type);
503 _reserved_in_bytes[type] = 0;
504 _committed_in_bytes[type] = 0;
505 _used_in_bytes[type] = 0;
506 _free_in_bytes[type] = 0;
507 }
508 }
509
510 void MetaspaceSnapshot::snapshot(Metaspace::MetadataType type, MetaspaceSnapshot& mss) {
511 assert_valid_metadata_type(type);
512
513 mss._reserved_in_bytes[type] = MetaspaceUtils::reserved_bytes(type);
514 mss._committed_in_bytes[type] = MetaspaceUtils::committed_bytes(type);
515 mss._used_in_bytes[type] = MetaspaceUtils::used_bytes(type);
516
517 size_t free_in_bytes = (MetaspaceUtils::capacity_bytes(type) - MetaspaceUtils::used_bytes(type))
518 + MetaspaceUtils::free_chunks_total_bytes(type)
519 + MetaspaceUtils::free_in_vs_bytes(type);
520 mss._free_in_bytes[type] = free_in_bytes;
521 }
522
523 void MetaspaceSnapshot::snapshot(MetaspaceSnapshot& mss) {
524 snapshot(Metaspace::ClassType, mss);
525 if (Metaspace::using_class_space()) {
526 snapshot(Metaspace::NonClassType, mss);
527 }
528 }
|