Skip to content
Permalink
Browse files
8264008: Incorrect metaspace statistics after JEP 387 when UseCompres…
…sedClassPointers is off

Reviewed-by: stuefe
  • Loading branch information
DamonFool committed Mar 24, 2021
1 parent 45e1bab commit 06d46d6c0b09458bb64171ed4ee2e2c06f4e006e
Showing with 15 additions and 4 deletions.
  1. +3 −3 src/hotspot/share/memory/metaspace.cpp
  2. +12 −1 test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventDefNewSerial.java
@@ -71,23 +71,23 @@ size_t MetaspaceUtils::used_words() {
}

size_t MetaspaceUtils::used_words(Metaspace::MetadataType mdtype) {
return Metaspace::is_class_space_allocation(mdtype) ? RunningCounters::used_words_class() : RunningCounters::used_words_nonclass();
return mdtype == Metaspace::ClassType ? RunningCounters::used_words_class() : RunningCounters::used_words_nonclass();
}

size_t MetaspaceUtils::reserved_words() {
return RunningCounters::reserved_words();
}

size_t MetaspaceUtils::reserved_words(Metaspace::MetadataType mdtype) {
return Metaspace::is_class_space_allocation(mdtype) ? RunningCounters::reserved_words_class() : RunningCounters::reserved_words_nonclass();
return mdtype == Metaspace::ClassType ? RunningCounters::reserved_words_class() : RunningCounters::reserved_words_nonclass();
}

size_t MetaspaceUtils::committed_words() {
return RunningCounters::committed_words();
}

size_t MetaspaceUtils::committed_words(Metaspace::MetadataType mdtype) {
return Metaspace::is_class_space_allocation(mdtype) ? RunningCounters::committed_words_class() : RunningCounters::committed_words_nonclass();
return mdtype == Metaspace::ClassType ? RunningCounters::committed_words_class() : RunningCounters::committed_words_nonclass();
}

void MetaspaceUtils::print_metaspace_change(const metaspace::MetaspaceSizesSnapshot& pre_meta_values) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,17 @@
* @library /test/lib /test/jdk
* @run main/othervm -XX:+UseSerialGC jdk.jfr.event.gc.heapsummary.TestHeapSummaryEventDefNewSerial
*/

/**
* @test
* @bug 8264008
* @key jfr
* @requires vm.hasJFR & vm.bits == 64
* @requires vm.gc == "Serial" | vm.gc == null
* @library /test/lib /test/jdk
* @run main/othervm -XX:+UseSerialGC -XX:-UseCompressedClassPointers
* jdk.jfr.event.gc.heapsummary.TestHeapSummaryEventDefNewSerial
*/
public class TestHeapSummaryEventDefNewSerial {
public static void main(String[] args) throws Exception {
HeapSummaryEventAllGcs.test(GCHelper.gcDefNew, GCHelper.gcSerialOld);

1 comment on commit 06d46d6

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 06d46d6 Mar 24, 2021

Please sign in to comment.