mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
8005108: NPG: MetaspaceAux::used_in_bytes(), capacity_in_bytes() and reserved_in_bytes() return inconsistent numbers
Reverted the changes to these functions from JDK-8000662 Reviewed-by: brutisso, jmasa
This commit is contained in:
parent
7fc460bae3
commit
da4c36cdcb
2 changed files with 12 additions and 21 deletions
|
@ -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) {
|
||||||
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) {
|
||||||
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 {
|
||||||
|
|
||||||
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();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue