8269571: NMT should print total malloc bytes and invocation count

Reviewed-by: zgu, xliu
This commit is contained in:
Thomas Stuefe 2021-06-30 04:38:33 +00:00
parent b969136b9f
commit 3ad20fcdfa
3 changed files with 25 additions and 5 deletions

View file

@ -60,6 +60,15 @@ size_t MemoryCounter::peak_size() const {
}
#endif
// Total malloc invocation count
size_t MallocMemorySnapshot::total_count() const {
size_t amount = 0;
for (int index = 0; index < mt_number_of_types; index ++) {
amount += _malloc[index].malloc_count();
}
return amount;
}
// Total malloc'd memory amount
size_t MallocMemorySnapshot::total() const {
size_t amount = 0;