# HG changeset patch # User jiefu # Date 1573802236 -28800 # Fri Nov 15 15:17:16 2019 +0800 # Node ID 3f019a33869c08c79b90007034a351e2006e4fa7 # Parent 11b96254ea925d683f23b9781fff885b32587a75 8234232: [TESTBUG] gc/shenandoah/jvmti/TestHeapDump.java fails with -Xcomp Reviewed-by: diff --git a/test/hotspot/jtreg/gc/shenandoah/jvmti/TestHeapDump.java b/test/hotspot/jtreg/gc/shenandoah/jvmti/TestHeapDump.java --- a/test/hotspot/jtreg/gc/shenandoah/jvmti/TestHeapDump.java +++ b/test/hotspot/jtreg/gc/shenandoah/jvmti/TestHeapDump.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved. + * Copyright (c) 2017, 2019, Red Hat, Inc. All rights reserved. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as @@ -40,6 +40,8 @@ * @run main/othervm/native/timeout=300 -agentlib:TestHeapDump -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -Xmx128m -XX:ShenandoahGCHeuristics=aggressive -XX:-UseCompressedOops TestHeapDump */ +import java.lang.ref.Reference; + public class TestHeapDump { private static final int NUM_ITER = 10000; @@ -86,6 +88,8 @@ throw new RuntimeException("Expected " + EXPECTED_OBJECTS + " objects, but got " + numObjs); } } + Reference.reachabilityFence(array); + Reference.reachabilityFence(localRoot); } // We look for the instances of this class during the heap scan