< prev index next >
src/share/vm/memory/metaspace.cpp
Print this page
@@ -162,14 +162,14 @@
}
}
void verify_free_chunks_count();
struct ChunkManagerStatistics {
- uint32_t num_by_type[NumberOfFreeLists];
+ size_t num_by_type[NumberOfFreeLists];
size_t single_size_by_type[NumberOfFreeLists];
size_t total_size_by_type[NumberOfFreeLists];
- uint32_t num_humongous_chunks;
+ size_t num_humongous_chunks;
size_t total_size_humongous_chunks;
};
void locked_get_statistics(ChunkManagerStatistics* stat) const;
void get_statistics(ChunkManagerStatistics* stat) const;
@@ -190,11 +190,11 @@
// Map a size to a list index assuming that there are lists
// for special, small, medium, and humongous chunks.
ChunkIndex list_index(size_t size);
// Map a given index to the chunk size.
- size_t size_by_index(ChunkIndex index);
+ size_t size_by_index(ChunkIndex index) const;
// Take a chunk from the ChunkManager. The chunk is expected to be in
// the chunk manager (the freelist if non-humongous, the dictionary if
// humongous).
void remove_chunk(Metachunk* chunk);
@@ -1799,14 +1799,14 @@
assert(size > med_size, "Not a humongous chunk");
return HumongousIndex;
}
-size_t ChunkManager::size_by_index(ChunkIndex index) {
+size_t ChunkManager::size_by_index(ChunkIndex index) const {
index_bounds_check(index);
assert(index != HumongousIndex, "Do not call for humongous chunks.");
- return free_chunks(index)->size();
+ return _free_chunks[index].size();
}
void ChunkManager::locked_verify_free_chunks_total() {
assert_lock_strong(SpaceManager::expand_lock());
assert(sum_free_chunks() == _free_chunks_total,
@@ -2054,21 +2054,21 @@
}
}
}
void ChunkManager::print_on(outputStream* out) const {
- const_cast<ChunkManager *>(this)->humongous_dictionary()->report_statistics(out);
+ _humongous_dictionary.report_statistics(out);
}
void ChunkManager::locked_get_statistics(ChunkManagerStatistics* stat) const {
assert_lock_strong(SpaceManager::expand_lock());
for (ChunkIndex i = ZeroIndex; i < NumberOfFreeLists; i = next_chunk_index(i)) {
- stat->num_by_type[i] = (uint32_t)num_free_chunks(i);
- stat->single_size_by_type[i] = const_cast<ChunkManager*>(this)->size_by_index(i);
+ stat->num_by_type[i] = num_free_chunks(i);
+ stat->single_size_by_type[i] = size_by_index(i);
stat->total_size_by_type[i] = size_free_chunks_in_bytes(i);
}
- stat->num_humongous_chunks = (uint32_t)num_free_chunks(HumongousIndex);
+ stat->num_humongous_chunks = num_free_chunks(HumongousIndex);
stat->total_size_humongous_chunks = size_free_chunks_in_bytes(HumongousIndex);
}
void ChunkManager::get_statistics(ChunkManagerStatistics* stat) const {
MutexLockerEx cl(SpaceManager::expand_lock(),
@@ -2077,17 +2077,17 @@
}
void ChunkManager::print_statistics(const ChunkManagerStatistics* stat, outputStream* out) {
size_t total = 0;
for (ChunkIndex i = ZeroIndex; i < NumberOfFreeLists; i = next_chunk_index(i)) {
- out->print_cr(" %u %s (" SIZE_FORMAT " bytes) chunks, total " SIZE_FORMAT " bytes",
+ out->print_cr(" " SIZE_FORMAT " %s (" SIZE_FORMAT " bytes) chunks, total " SIZE_FORMAT " bytes",
stat->num_by_type[i], chunk_size_name(i),
stat->single_size_by_type[i],
stat->total_size_by_type[i]);
total += stat->total_size_by_type[i];
}
- out->print_cr(" %u humongous chunks, total " SIZE_FORMAT " bytes",
+ out->print_cr(" " SIZE_FORMAT " humongous chunks, total " SIZE_FORMAT " bytes",
stat->num_humongous_chunks, stat->total_size_humongous_chunks);
total += stat->total_size_humongous_chunks;
out->print_cr(" total size: " SIZE_FORMAT ".", total);
}
< prev index next >