diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp index 42870cd0fda3b8022a59358decd6a226e50f1230..6c0b4210faa55b25ca01aeb20d04b215b2892ba9 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -2192,11 +2192,6 @@ void SpaceManager::mangle_freed_chunks() { // MetaspaceAux -size_t MetaspaceAux::used_in_bytes() { - return (Metaspace::class_space_list()->used_words_sum() + - Metaspace::space_list()->used_words_sum()) * BytesPerWord; -} - size_t MetaspaceAux::used_in_bytes(Metaspace::MetadataType mdtype) { size_t used = 0; ClassLoaderDataGraphMetaspaceIterator iter; @@ -2222,14 +2217,6 @@ size_t MetaspaceAux::free_in_bytes(Metaspace::MetadataType mdtype) { return free * BytesPerWord; } -// The total words available for metadata allocation. This -// uses Metaspace capacity_words() which is the total words -// in chunks allocated for a Metaspace. -size_t MetaspaceAux::capacity_in_bytes() { - return (Metaspace::class_space_list()->capacity_words_sum() + - Metaspace::space_list()->capacity_words_sum()) * BytesPerWord; -} - size_t MetaspaceAux::capacity_in_bytes(Metaspace::MetadataType mdtype) { size_t capacity = free_chunks_total(mdtype); ClassLoaderDataGraphMetaspaceIterator iter; @@ -2242,11 +2229,6 @@ size_t MetaspaceAux::capacity_in_bytes(Metaspace::MetadataType mdtype) { return capacity * BytesPerWord; } -size_t MetaspaceAux::reserved_in_bytes() { - return (Metaspace::class_space_list()->virtual_space_total() + - Metaspace::space_list()->virtual_space_total()) * BytesPerWord; -} - size_t MetaspaceAux::reserved_in_bytes(Metaspace::MetadataType mdtype) { size_t reserved = (mdtype == Metaspace::ClassType) ? Metaspace::class_space_list()->virtual_space_total() : diff --git a/hotspot/src/share/vm/memory/metaspace.hpp b/hotspot/src/share/vm/memory/metaspace.hpp index 993419436bba731c1601f11177e9ba2d8c9d8133..bfc6d90ae6588d5c0467a9917922eca646910752 100644 --- a/hotspot/src/share/vm/memory/metaspace.hpp +++ b/hotspot/src/share/vm/memory/metaspace.hpp @@ -156,16 +156,25 @@ class MetaspaceAux : AllStatic { public: // Total of space allocated to metadata in all Metaspaces - static size_t used_in_bytes(); + static size_t used_in_bytes() { + return used_in_bytes(Metaspace::ClassType) + + used_in_bytes(Metaspace::NonClassType); + } // Total of available space in all Metaspaces // Total of capacity allocated to all Metaspaces. This includes // space in Metachunks not yet allocated and in the Metachunk // freelist. - static size_t capacity_in_bytes(); + static size_t capacity_in_bytes() { + return capacity_in_bytes(Metaspace::ClassType) + + capacity_in_bytes(Metaspace::NonClassType); + } // Total space reserved in all Metaspaces - static size_t reserved_in_bytes(); + static size_t reserved_in_bytes() { + return reserved_in_bytes(Metaspace::ClassType) + + reserved_in_bytes(Metaspace::NonClassType); + } static size_t min_chunk_size();