66 int _bytes [2][_number_of_types];
67
68 public:
69 enum { RO = 0, RW = 1 };
70
71 DumpAllocStats() {
72 memset(_counts, 0, sizeof(_counts));
73 memset(_bytes, 0, sizeof(_bytes));
74 };
75
76 CompactHashtableStats* symbol_stats() { return &_symbol_stats; }
77 CompactHashtableStats* string_stats() { return &_string_stats; }
78
79 void record(MetaspaceObj::Type type, int byte_size, bool read_only) {
80 assert(int(type) >= 0 && type < MetaspaceObj::_number_of_types, "sanity");
81 int which = (read_only) ? RO : RW;
82 _counts[which][type] ++;
83 _bytes [which][type] += byte_size;
84 }
85
86 void record_modules(int byte_size, bool read_only) {
87 int which = (read_only) ? RO : RW;
88 _bytes [which][ModulesNativesType] += byte_size;
89 }
90
91 void record_other_type(int byte_size, bool read_only) {
92 int which = (read_only) ? RO : RW;
93 _bytes [which][OtherType] += byte_size;
94 }
95
96 void record_cpp_vtables(int byte_size) {
97 _bytes[RW][CppVTablesType] += byte_size;
98 }
99
100 void print_stats(int ro_all, int rw_all);
101 };
102
103 #endif // SHARE_CDS_DUMPALLOCSTATS_HPP
|
66 int _bytes [2][_number_of_types];
67
68 public:
69 enum { RO = 0, RW = 1 };
70
71 DumpAllocStats() {
72 memset(_counts, 0, sizeof(_counts));
73 memset(_bytes, 0, sizeof(_bytes));
74 };
75
76 CompactHashtableStats* symbol_stats() { return &_symbol_stats; }
77 CompactHashtableStats* string_stats() { return &_string_stats; }
78
79 void record(MetaspaceObj::Type type, int byte_size, bool read_only) {
80 assert(int(type) >= 0 && type < MetaspaceObj::_number_of_types, "sanity");
81 int which = (read_only) ? RO : RW;
82 _counts[which][type] ++;
83 _bytes [which][type] += byte_size;
84 }
85
86 DEBUG_ONLY(void verify(int expected_byte_size, bool read_only) const;)
87
88 void record_modules(int byte_size, bool read_only) {
89 int which = (read_only) ? RO : RW;
90 _bytes [which][ModulesNativesType] += byte_size;
91 }
92
93 void record_other_type(int byte_size, bool read_only) {
94 int which = (read_only) ? RO : RW;
95 _bytes [which][OtherType] += byte_size;
96 }
97
98 void record_cpp_vtables(int byte_size) {
99 _bytes[RW][CppVTablesType] += byte_size;
100 }
101
102 void print_stats(int ro_all, int rw_all);
103 };
104
105 #endif // SHARE_CDS_DUMPALLOCSTATS_HPP
|