< prev index next >

src/hotspot/share/memory/metaspace/metaspaceStatistics.cpp

Print this page

169       }
170 
171       st->cr_indent();
172       st->print("%15s: ", "-total-");
173       totals().print_on(st, scale);
174     }
175     if (_free_blocks_num > 0) {
176       st->cr_indent();
177       st->print("deallocated: " UINTX_FORMAT " blocks with ", _free_blocks_num);
178       print_scaled_words(st, _free_blocks_word_size, scale);
179     }
180   } else {
181     totals().print_on(st, scale);
182     st->print(", ");
183     st->print("deallocated: " UINTX_FORMAT " blocks with ", _free_blocks_num);
184     print_scaled_words(st, _free_blocks_word_size, scale);
185   }
186 }
187 
188 #ifdef ASSERT
189 
190 void ArenaStats::verify() const {
191   size_t total_used = 0;
192   for (chunklevel_t l = chunklevel::LOWEST_CHUNK_LEVEL; l <= chunklevel::HIGHEST_CHUNK_LEVEL; l++) {
193     _stats[l].verify();
194     total_used += _stats[l]._used_words;
195   }
196   // Deallocated allocations still count as used
197   assert(total_used >= _free_blocks_word_size,
198          "Sanity");
199 }
200 #endif
201 
202 // Returns total arena statistics for both class and non-class metaspace
203 ArenaStats ClmsStats::totals() const {
204   ArenaStats out;
205   out.add(_arena_stats_nonclass);
206   out.add(_arena_stats_class);
207   return out;
208 }
209 
210 void ClmsStats::print_on(outputStream* st, size_t scale, bool detailed) const {
211   streamIndentor sti(st);
212   st->cr_indent();
213   if (Metaspace::using_class_space()) {
214     st->print("Non-Class: ");
215   }
216   _arena_stats_nonclass.print_on(st, scale, detailed);
217   if (detailed) {
218     st->cr();

169       }
170 
171       st->cr_indent();
172       st->print("%15s: ", "-total-");
173       totals().print_on(st, scale);
174     }
175     if (_free_blocks_num > 0) {
176       st->cr_indent();
177       st->print("deallocated: " UINTX_FORMAT " blocks with ", _free_blocks_num);
178       print_scaled_words(st, _free_blocks_word_size, scale);
179     }
180   } else {
181     totals().print_on(st, scale);
182     st->print(", ");
183     st->print("deallocated: " UINTX_FORMAT " blocks with ", _free_blocks_num);
184     print_scaled_words(st, _free_blocks_word_size, scale);
185   }
186 }
187 
188 #ifdef ASSERT

189 void ArenaStats::verify() const {
190   size_t total_used = 0;
191   for (chunklevel_t l = chunklevel::LOWEST_CHUNK_LEVEL; l <= chunklevel::HIGHEST_CHUNK_LEVEL; l++) {
192     _stats[l].verify();
193     total_used += _stats[l]._used_words;
194   }



195 }
196 #endif
197 
198 // Returns total arena statistics for both class and non-class metaspace
199 ArenaStats ClmsStats::totals() const {
200   ArenaStats out;
201   out.add(_arena_stats_nonclass);
202   out.add(_arena_stats_class);
203   return out;
204 }
205 
206 void ClmsStats::print_on(outputStream* st, size_t scale, bool detailed) const {
207   streamIndentor sti(st);
208   st->cr_indent();
209   if (Metaspace::using_class_space()) {
210     st->print("Non-Class: ");
211   }
212   _arena_stats_nonclass.print_on(st, scale, detailed);
213   if (detailed) {
214     st->cr();
< prev index next >