1.1 --- a/src/share/vm/memory/metaspace.cpp Thu Dec 21 19:11:17 2017 -0500 1.2 +++ b/src/share/vm/memory/metaspace.cpp Mon Dec 25 00:08:23 2017 -0500 1.3 @@ -706,6 +706,7 @@ 1.4 size_t allocated_blocks_words() const { return _allocated_blocks_words; } 1.5 size_t allocated_blocks_bytes() const { return _allocated_blocks_words * BytesPerWord; } 1.6 size_t allocated_chunks_words() const { return _allocated_chunks_words; } 1.7 + size_t allocated_chunks_bytes() const { return _allocated_chunks_words * BytesPerWord; } 1.8 size_t allocated_chunks_count() const { return _allocated_chunks_count; } 1.9 1.10 bool is_humongous(size_t word_size) { return word_size > medium_chunk_size(); } 1.11 @@ -3463,6 +3464,16 @@ 1.12 return capacity_words_slow(mdtype) * BytesPerWord; 1.13 } 1.14 1.15 +size_t Metaspace::allocated_blocks_bytes() const { 1.16 + return vsm()->allocated_blocks_bytes() + 1.17 + (using_class_space() ? class_vsm()->allocated_blocks_bytes() : 0); 1.18 +} 1.19 + 1.20 +size_t Metaspace::allocated_chunks_bytes() const { 1.21 + return vsm()->allocated_chunks_bytes() + 1.22 + (using_class_space() ? class_vsm()->allocated_chunks_bytes() : 0); 1.23 +} 1.24 + 1.25 void Metaspace::deallocate(MetaWord* ptr, size_t word_size, bool is_class) { 1.26 if (SafepointSynchronize::is_at_safepoint()) { 1.27 if (DumpSharedSpaces && PrintSharedSpaces) {