Skip to content

Commit 0be7118

Browse files
committed
8279016: JFR Leak Profiler is broken with Shenandoah
Reviewed-by: egahlin, rkennke, mgronlun, wkemper
1 parent 6811a11 commit 0be7118

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

make/RunTests.gmk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,10 @@ define SetupRunJtregTestBody
856856
JTREG_AUTO_PROBLEM_LISTS += ProblemList-zgc.txt
857857
endif
858858

859+
ifneq ($$(findstring -XX:+UseShenandoahGC, $$(JTREG_ALL_OPTIONS)), )
860+
JTREG_AUTO_PROBLEM_LISTS += ProblemList-shenandoah.txt
861+
endif
862+
859863
ifneq ($$(JTREG_EXTRA_PROBLEM_LISTS), )
860864
# Accept both absolute paths as well as relative to the current test root.
861865
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \

src/hotspot/share/jfr/leakprofiler/leakProfiler.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@
3434
#include "runtime/javaThread.inline.hpp"
3535
#include "runtime/vmThread.hpp"
3636

37+
bool LeakProfiler::is_supported() {
38+
if (UseShenandoahGC) {
39+
// Leak Profiler uses mark words in the ways that might interfere
40+
// with concurrent GC uses of them. This affects Shenandoah.
41+
return false;
42+
}
43+
return true;
44+
}
45+
3746
bool LeakProfiler::is_running() {
3847
return ObjectSampler::is_created();
3948
}
@@ -48,6 +57,12 @@ bool LeakProfiler::start(int sample_count) {
4857
return false;
4958
}
5059

60+
// Exit cleanly if not supported
61+
if (!is_supported()) {
62+
log_trace(jfr, system)("Object sampling is not supported");
63+
return false;
64+
}
65+
5166
assert(!is_running(), "invariant");
5267
assert(sample_count > 0, "invariant");
5368

src/hotspot/share/jfr/leakprofiler/leakProfiler.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class LeakProfiler : public AllStatic {
3535
static bool start(int sample_count);
3636
static bool stop();
3737
static bool is_running();
38+
static bool is_supported();
3839

3940
static void emit_events(int64_t cutoff_ticks, bool emit_all, bool skip_bfs);
4041
static void sample(HeapWord* object, size_t size, JavaThread* thread);
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#
2+
# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
3+
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
#
5+
# This code is free software; you can redistribute it and/or modify it
6+
# under the terms of the GNU General Public License version 2 only, as
7+
# published by the Free Software Foundation.
8+
#
9+
# This code is distributed in the hope that it will be useful, but WITHOUT
10+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
# version 2 for more details (a copy is included in the LICENSE file that
13+
# accompanied this code).
14+
#
15+
# You should have received a copy of the GNU General Public License version
16+
# 2 along with this work; if not, write to the Free Software Foundation,
17+
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
#
19+
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
# or visit www.oracle.com if you need additional information or have any
21+
# questions.
22+
#
23+
24+
#############################################################################
25+
#
26+
# List of quarantined tests for testing with Shenandoah.
27+
#
28+
#############################################################################
29+
30+
# Quiet all LeakProfiler tests
31+
32+
jdk/jfr/api/consumer/TestRecordingFileWrite.java 8342951 generic-all
33+
jdk/jfr/event/oldobject/TestAllocationTime.java 8342951 generic-all
34+
jdk/jfr/event/oldobject/TestArrayInformation.java 8342951 generic-all
35+
jdk/jfr/event/oldobject/TestCircularReference.java 8342951 generic-all
36+
jdk/jfr/event/oldobject/TestClassLoaderLeak.java 8342951 generic-all
37+
jdk/jfr/event/oldobject/TestFieldInformation.java 8342951 generic-all
38+
jdk/jfr/event/oldobject/TestG1.java 8342951 generic-all
39+
jdk/jfr/event/oldobject/TestHeapDeep.java 8342951 generic-all
40+
jdk/jfr/event/oldobject/TestHeapShallow.java 8342951 generic-all
41+
jdk/jfr/event/oldobject/TestLargeRootSet.java 8342951 generic-all
42+
jdk/jfr/event/oldobject/TestLastKnownHeapUsage.java 8342951 generic-all
43+
jdk/jfr/event/oldobject/TestListenerLeak.java 8342951 generic-all
44+
jdk/jfr/event/oldobject/TestMetadataRetention.java 8342951 generic-all
45+
jdk/jfr/event/oldobject/TestObjectAge.java 8342951 generic-all
46+
jdk/jfr/event/oldobject/TestObjectDescription.java 8342951 generic-all
47+
jdk/jfr/event/oldobject/TestObjectSize.java 8342951 generic-all
48+
jdk/jfr/event/oldobject/TestParallel.java 8342951 generic-all
49+
jdk/jfr/event/oldobject/TestReferenceChainLimit.java 8342951 generic-all
50+
jdk/jfr/event/oldobject/TestSanityDefault.java 8342951 generic-all
51+
jdk/jfr/event/oldobject/TestSerial.java 8342951 generic-all
52+
jdk/jfr/event/oldobject/TestShenandoah.java 8342951 generic-all
53+
jdk/jfr/event/oldobject/TestThreadLocalLeak.java 8342951 generic-all
54+
jdk/jfr/event/oldobject/TestZ.java 8342951 generic-all
55+
jdk/jfr/jcmd/TestJcmdDump.java 8342951 generic-all
56+
jdk/jfr/jcmd/TestJcmdDumpPathToGCRoots.java 8342951 generic-all
57+
jdk/jfr/jcmd/TestJcmdStartPathToGCRoots.java 8342951 generic-all
58+
jdk/jfr/jvm/TestWaste.java 8342951 generic-all
59+
jdk/jfr/startupargs/TestOldObjectQueueSize.java 8342951 generic-all
60+

0 commit comments

Comments
 (0)