Skip to content

Commit 6a69e30

Browse files
committed
8256337: ap01t001.cpp, 67: Received unexpected number of ObjectFree events: 7
Reviewed-by: coleenp, sspitsyn
1 parent 298bce1 commit 6a69e30

File tree

1 file changed

+3
-1
lines changed
  • test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP01

1 file changed

+3
-1
lines changed

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/allocation/AP01/ap01t001.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
public class ap01t001 extends DebugeeClass implements Cloneable {
3333
/* number of interations to provoke garbage collecting */
3434
final static int GC_TRYS = 4;
35+
// Prevent test run instance from being freed too early
36+
static ap01t001 keepAlive;
3537

3638
public static void main(String[] argv) {
3739
argv = nsk.share.jvmti.JVMTITest.commonInit(argv);
@@ -41,7 +43,7 @@ public static void main(String[] argv) {
4143
}
4244

4345
public static int run(String argv[], PrintStream out) {
44-
return new ap01t001().runThis(argv, out);
46+
return (keepAlive = new ap01t001()).runThis(argv, out);
4547
}
4648
/*
4749
private native void setTag();

0 commit comments

Comments
 (0)