63 }
64
65 CompactHashtableStats _symbol_stats;
66 CompactHashtableStats _string_stats;
67
68 int _counts[2][_number_of_types];
69 int _bytes [2][_number_of_types];
70
71 int _num_field_cp_entries;
72 int _num_field_cp_entries_archived;
73 int _num_field_cp_entries_reverted;
74 int _num_indy_cp_entries;
75 int _num_indy_cp_entries_archived;
76 int _num_indy_cp_entries_reverted;
77 int _num_klass_cp_entries;
78 int _num_klass_cp_entries_archived;
79 int _num_klass_cp_entries_reverted;
80 int _num_method_cp_entries;
81 int _num_method_cp_entries_archived;
82 int _num_method_cp_entries_reverted;
83
84 public:
85 enum { RO = 0, RW = 1 };
86
87 DumpAllocStats() {
88 memset(_counts, 0, sizeof(_counts));
89 memset(_bytes, 0, sizeof(_bytes));
90 _num_field_cp_entries = 0;
91 _num_field_cp_entries_archived = 0;
92 _num_field_cp_entries_reverted = 0;
93 _num_indy_cp_entries = 0;
94 _num_indy_cp_entries_archived = 0;
95 _num_indy_cp_entries_reverted = 0;
96 _num_klass_cp_entries = 0;
97 _num_klass_cp_entries_archived = 0;
98 _num_klass_cp_entries_reverted = 0;
99 _num_method_cp_entries = 0;
100 _num_method_cp_entries_archived = 0;
101 _num_method_cp_entries_reverted = 0;
102 };
103
104 CompactHashtableStats* symbol_stats() { return &_symbol_stats; }
105 CompactHashtableStats* string_stats() { return &_string_stats; }
106
107 void record(MetaspaceClosureType type, int byte_size, bool read_only) {
108 int t = (int)type;
109 assert(t >= 0 && t < (int)MetaspaceClosureType::_number_of_types, "sanity");
110 int which = (read_only) ? RO : RW;
111 _counts[which][t] ++;
112 _bytes [which][t] += byte_size;
113 }
114
115 void record_gap(int byte_size) {
116 _counts[RW][GapType] += 1;
117 _bytes [RW][GapType] += byte_size;
118 }
119
120 void record_other_type(int byte_size, bool read_only) {
121 int which = (read_only) ? RO : RW;
135 }
136
137 void record_indy_cp_entry(bool archived, bool reverted) {
138 _num_indy_cp_entries ++;
139 _num_indy_cp_entries_archived += archived ? 1 : 0;
140 _num_indy_cp_entries_reverted += reverted ? 1 : 0;
141 }
142
143 void record_klass_cp_entry(bool archived, bool reverted) {
144 _num_klass_cp_entries ++;
145 _num_klass_cp_entries_archived += archived ? 1 : 0;
146 _num_klass_cp_entries_reverted += reverted ? 1 : 0;
147 }
148
149 void record_method_cp_entry(bool archived, bool reverted) {
150 _num_method_cp_entries ++;
151 _num_method_cp_entries_archived += archived ? 1 : 0;
152 _num_method_cp_entries_reverted += reverted ? 1 : 0;
153 }
154
155 void print_stats(int ro_all, int rw_all);
156 };
157
158 #endif // SHARE_CDS_DUMPALLOCSTATS_HPP
|
63 }
64
65 CompactHashtableStats _symbol_stats;
66 CompactHashtableStats _string_stats;
67
68 int _counts[2][_number_of_types];
69 int _bytes [2][_number_of_types];
70
71 int _num_field_cp_entries;
72 int _num_field_cp_entries_archived;
73 int _num_field_cp_entries_reverted;
74 int _num_indy_cp_entries;
75 int _num_indy_cp_entries_archived;
76 int _num_indy_cp_entries_reverted;
77 int _num_klass_cp_entries;
78 int _num_klass_cp_entries_archived;
79 int _num_klass_cp_entries_reverted;
80 int _num_method_cp_entries;
81 int _num_method_cp_entries_archived;
82 int _num_method_cp_entries_reverted;
83 int _num_dynamic_proxy_classes;
84
85 public:
86 enum { RO = 0, RW = 1 };
87
88 DumpAllocStats() {
89 memset(_counts, 0, sizeof(_counts));
90 memset(_bytes, 0, sizeof(_bytes));
91 _num_field_cp_entries = 0;
92 _num_field_cp_entries_archived = 0;
93 _num_field_cp_entries_reverted = 0;
94 _num_indy_cp_entries = 0;
95 _num_indy_cp_entries_archived = 0;
96 _num_indy_cp_entries_reverted = 0;
97 _num_klass_cp_entries = 0;
98 _num_klass_cp_entries_archived = 0;
99 _num_klass_cp_entries_reverted = 0;
100 _num_method_cp_entries = 0;
101 _num_method_cp_entries_archived = 0;
102 _num_method_cp_entries_reverted = 0;
103 _num_dynamic_proxy_classes = 0;
104 };
105
106 CompactHashtableStats* symbol_stats() { return &_symbol_stats; }
107 CompactHashtableStats* string_stats() { return &_string_stats; }
108
109 void record(MetaspaceClosureType type, int byte_size, bool read_only) {
110 int t = (int)type;
111 assert(t >= 0 && t < (int)MetaspaceClosureType::_number_of_types, "sanity");
112 int which = (read_only) ? RO : RW;
113 _counts[which][t] ++;
114 _bytes [which][t] += byte_size;
115 }
116
117 void record_gap(int byte_size) {
118 _counts[RW][GapType] += 1;
119 _bytes [RW][GapType] += byte_size;
120 }
121
122 void record_other_type(int byte_size, bool read_only) {
123 int which = (read_only) ? RO : RW;
137 }
138
139 void record_indy_cp_entry(bool archived, bool reverted) {
140 _num_indy_cp_entries ++;
141 _num_indy_cp_entries_archived += archived ? 1 : 0;
142 _num_indy_cp_entries_reverted += reverted ? 1 : 0;
143 }
144
145 void record_klass_cp_entry(bool archived, bool reverted) {
146 _num_klass_cp_entries ++;
147 _num_klass_cp_entries_archived += archived ? 1 : 0;
148 _num_klass_cp_entries_reverted += reverted ? 1 : 0;
149 }
150
151 void record_method_cp_entry(bool archived, bool reverted) {
152 _num_method_cp_entries ++;
153 _num_method_cp_entries_archived += archived ? 1 : 0;
154 _num_method_cp_entries_reverted += reverted ? 1 : 0;
155 }
156
157 void record_dynamic_proxy_class() {
158 _num_dynamic_proxy_classes ++;
159 }
160
161 void print_stats(int ro_all, int rw_all);
162 };
163
164 #endif // SHARE_CDS_DUMPALLOCSTATS_HPP
|