提交 69d81c04 编写于 作者: S stefank

8005108: NPG: MetaspaceAux::used_in_bytes(), capacity_in_bytes() and...

8005108: NPG: MetaspaceAux::used_in_bytes(), capacity_in_bytes() and reserved_in_bytes() return inconsistent numbers
Summary: Reverted the changes to these functions from JDK-8000662
Reviewed-by: brutisso, jmasa
上级 f9f7d210
...@@ -2192,11 +2192,6 @@ void SpaceManager::mangle_freed_chunks() { ...@@ -2192,11 +2192,6 @@ void SpaceManager::mangle_freed_chunks() {
// MetaspaceAux // 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 MetaspaceAux::used_in_bytes(Metaspace::MetadataType mdtype) {
size_t used = 0; size_t used = 0;
ClassLoaderDataGraphMetaspaceIterator iter; ClassLoaderDataGraphMetaspaceIterator iter;
...@@ -2222,14 +2217,6 @@ size_t MetaspaceAux::free_in_bytes(Metaspace::MetadataType mdtype) { ...@@ -2222,14 +2217,6 @@ size_t MetaspaceAux::free_in_bytes(Metaspace::MetadataType mdtype) {
return free * BytesPerWord; 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 MetaspaceAux::capacity_in_bytes(Metaspace::MetadataType mdtype) {
size_t capacity = free_chunks_total(mdtype); size_t capacity = free_chunks_total(mdtype);
ClassLoaderDataGraphMetaspaceIterator iter; ClassLoaderDataGraphMetaspaceIterator iter;
...@@ -2242,11 +2229,6 @@ size_t MetaspaceAux::capacity_in_bytes(Metaspace::MetadataType mdtype) { ...@@ -2242,11 +2229,6 @@ size_t MetaspaceAux::capacity_in_bytes(Metaspace::MetadataType mdtype) {
return capacity * BytesPerWord; 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 MetaspaceAux::reserved_in_bytes(Metaspace::MetadataType mdtype) {
size_t reserved = (mdtype == Metaspace::ClassType) ? size_t reserved = (mdtype == Metaspace::ClassType) ?
Metaspace::class_space_list()->virtual_space_total() : Metaspace::class_space_list()->virtual_space_total() :
......
...@@ -156,16 +156,25 @@ class MetaspaceAux : AllStatic { ...@@ -156,16 +156,25 @@ class MetaspaceAux : AllStatic {
public: public:
// Total of space allocated to metadata in all Metaspaces // 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 available space in all Metaspaces
// Total of capacity allocated to all Metaspaces. This includes // Total of capacity allocated to all Metaspaces. This includes
// space in Metachunks not yet allocated and in the Metachunk // space in Metachunks not yet allocated and in the Metachunk
// freelist. // 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 // 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(); static size_t min_chunk_size();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册