8370732: Use WhiteBox.getWhiteBox().fullGC() to provoking gc for nsk/jvmti tests

Reviewed-by: cjplummer, lmesnik, sspitsyn
This commit is contained in:
SendaoYan 2025-11-01 02:04:43 +00:00
parent 2fc4cbe426
commit 54fe50210e
27 changed files with 65 additions and 266 deletions

View File

@ -1,24 +0,0 @@
#
# Copyright (c) 2018, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
exclusiveAccess.dirs=.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2025, 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
@ -37,7 +37,7 @@
* Test scenario:
* - during initialization (from function Agent_OnAttach) agent starts auxiliary thread waiting on
* raw monitor and enables GarbageCollectionStart and GarbageCollectionFinish events
* - target application provokes garbage collection (calls System.gc())
* - target application provokes garbage collection (calls WhiteBox.getWhiteBox().fullGC())
* - agent receives event GarbageCollectionStart
* - agent receives event GarbageCollectionFinish event and notifies waiting auxiliary thread
* - notified auxiliary thread notifies target application that agent finished its work
@ -48,11 +48,13 @@
* /test/lib
* @build nsk.share.aod.AODTestRunner
* nsk.jvmti.AttachOnDemand.attach020.attach020Target
* @build jdk.test.whitebox.WhiteBox
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
* @run main/othervm/native
* nsk.share.aod.AODTestRunner
* -jdk ${test.jdk}
* -target nsk.jvmti.AttachOnDemand.attach020.attach020Target
* -javaOpts="-XX:+UsePerfData ${test.vm.opts} ${test.java.opts}"
* -javaOpts="-XX:+UsePerfData ${test.vm.opts} ${test.java.opts} -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI"
* -na attach020Agent00
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2025, 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
@ -22,14 +22,14 @@
*/
package nsk.jvmti.AttachOnDemand.attach020;
import nsk.share.ClassUnloader;
import nsk.share.aod.TargetApplicationWaitingAgents;
import jdk.test.whitebox.WhiteBox;
public class attach020Target extends TargetApplicationWaitingAgents {
protected void targetApplicationActions() {
log.display("Provoking garbage collection");
ClassUnloader.eatMemory();
WhiteBox.getWhiteBox().fullGC();
}
public static void main(String[] args) {

View File

@ -1,24 +0,0 @@
#
# Copyright (c) 2018, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
exclusiveAccess.dirs=.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2025, 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
@ -44,11 +44,13 @@
* /test/lib
* @build nsk.share.aod.AODTestRunner
* nsk.jvmti.AttachOnDemand.attach021.attach021Target
* @build jdk.test.whitebox.WhiteBox
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
* @run main/othervm/native
* nsk.share.aod.AODTestRunner
* -jdk ${test.jdk}
* -target nsk.jvmti.AttachOnDemand.attach021.attach021Target
* -javaOpts="-XX:+UsePerfData ${test.vm.opts} ${test.java.opts}"
* -javaOpts="-XX:+UsePerfData ${test.vm.opts} ${test.java.opts} -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI"
* -na attach021Agent00
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2025, 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
@ -22,8 +22,8 @@
*/
package nsk.jvmti.AttachOnDemand.attach021;
import nsk.share.ClassUnloader;
import nsk.share.aod.TargetApplicationWaitingAgents;
import jdk.test.whitebox.WhiteBox;
public class attach021Target extends TargetApplicationWaitingAgents {
@ -51,7 +51,7 @@ public class attach021Target extends TargetApplicationWaitingAgents {
try {
if (createTaggedObject()) {
log.display("Provoking GC");
ClassUnloader.eatMemory();
WhiteBox.getWhiteBox().fullGC();
}
} finally {
shutdownAgent();

View File

@ -1,24 +0,0 @@
#
# Copyright (c) 2018, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
exclusiveAccess.dirs=.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2025, 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
@ -47,11 +47,13 @@
* /test/lib
* @build nsk.share.aod.AODTestRunner
* nsk.jvmti.AttachOnDemand.attach022.attach022Target
* @build jdk.test.whitebox.WhiteBox
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
* @run main/othervm/native
* nsk.share.aod.AODTestRunner
* -jdk ${test.jdk}
* -target nsk.jvmti.AttachOnDemand.attach022.attach022Target
* -javaOpts="-XX:+UsePerfData ${test.vm.opts} ${test.java.opts}"
* -javaOpts="-XX:+UsePerfData ${test.vm.opts} ${test.java.opts} -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI"
* -na attach022Agent00
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2025, 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
@ -22,8 +22,8 @@
*/
package nsk.jvmti.AttachOnDemand.attach022;
import nsk.share.ClassUnloader;
import nsk.share.aod.TargetApplicationWaitingAgents;
import jdk.test.whitebox.WhiteBox;
class ClassForAllocationEventsTest {
@ -47,7 +47,7 @@ public class attach022Target extends TargetApplicationWaitingAgents {
}
log.display("Provoking GC");
ClassUnloader.eatMemory();
WhiteBox.getWhiteBox().fullGC();
} finally {
if (!shutdownAgent(TEST_ALLOCATION_NUMBER)) {
setStatusFailed("Error happened during agent work, see error messages for details");

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -27,6 +27,7 @@ import java.io.*;
import java.math.*;
import nsk.share.*;
import jdk.test.whitebox.WhiteBox;
/**
* This test exercises the JVMTI event <code>GarbageCollectionFinish</code>.
@ -63,7 +64,7 @@ public class gcfinish001 {
private int runThis(String argv[], PrintStream out) {
try {
for (int i=0; i<ITERATIONS; i++)
ClassUnloader.eatMemory(); // provoke garbage collecting
WhiteBox.getWhiteBox().fullGC(); // provoke garbage collecting
} catch (OutOfMemoryError e) {
// ignoring
}

View File

@ -1,24 +0,0 @@
#
# Copyright (c) 2018, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
exclusiveAccess.dirs=.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2025, 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
@ -40,8 +40,11 @@
*
* @library /vmTestbase
* /test/lib
* @build jdk.test.whitebox.WhiteBox
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
* @run main/othervm/native
* -XX:-UseGCOverheadLimit
* -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -agentlib:gcfinish001=-waittime=5
* nsk.jvmti.GarbageCollectionFinish.gcfinish001
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -27,6 +27,7 @@ import java.io.*;
import java.math.*;
import nsk.share.*;
import jdk.test.whitebox.WhiteBox;
/**
* This test exercises the JVMTI event <code>GarbageCollectionStart</code>.
@ -63,13 +64,7 @@ public class gcstart001 {
}
private int runThis(String argv[], PrintStream out) {
try {
for (int i=0; i<ITERATIONS; i++)
ClassUnloader.eatMemory(); // provoke garbage collecting
} catch (OutOfMemoryError e) {
// ignoring
}
WhiteBox.getWhiteBox().fullGC(); // provoke garbage collecting
return Consts.TEST_PASSED;
}
}

View File

@ -1,24 +0,0 @@
#
# Copyright (c) 2018, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
exclusiveAccess.dirs=.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2025, 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
@ -40,8 +40,11 @@
*
* @library /vmTestbase
* /test/lib
* @build jdk.test.whitebox.WhiteBox
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
* @run main/othervm/native
* -XX:-UseGCOverheadLimit
* -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -agentlib:gcstart001=-waittime=5
* nsk.jvmti.GarbageCollectionStart.gcstart001
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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
@ -27,6 +27,7 @@ import java.io.*;
import java.math.*;
import nsk.share.*;
import jdk.test.whitebox.WhiteBox;
/**
* This test exercises the JVMTI event <code>GarbageCollectionStart</code>.
@ -61,13 +62,7 @@ public class gcstart002 {
}
private int runThis(String argv[], PrintStream out) {
try {
for (int i=0; i<ITERATIONS; i++)
ClassUnloader.eatMemory(); // provoke garbage collecting
} catch (OutOfMemoryError e) {
// ignoring
}
WhiteBox.getWhiteBox().fullGC(); // provoke garbage collecting
return Consts.TEST_PASSED;
}
}

View File

@ -1,24 +0,0 @@
#
# Copyright (c) 2018, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
exclusiveAccess.dirs=.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2025, 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
@ -40,8 +40,11 @@
*
* @library /vmTestbase
* /test/lib
* @build jdk.test.whitebox.WhiteBox
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
* @run main/othervm/native
* -XX:-UseGCOverheadLimit
* -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* -agentlib:gcstart002=-waittime=5
* nsk.jvmti.GarbageCollectionStart.gcstart002
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2025, 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
@ -28,10 +28,9 @@ import java.lang.ref.*;
import nsk.share.*;
import nsk.share.jvmti.*;
import jdk.test.whitebox.WhiteBox;
public class ap12t001 extends DebugeeClass {
/* number of interations to provoke garbage collecting */
final static int GC_TRYS = 1;
public static void main(String[] argv) {
argv = nsk.share.jvmti.JVMTITest.commonInit(argv);
@ -70,9 +69,8 @@ public class ap12t001 extends DebugeeClass {
log.display("References are ready for garbage collection");
status = checkStatus(status);
// Provoke OutOfMemoryError in order to clear all soft references
for (int i= 0; i < GC_TRYS; i++)
ClassUnloader.eatMemory();
// Provoke fullgc in order to clear all soft references
WhiteBox.getWhiteBox().fullGC();
log.display("GC called");
flushObjectFreeEvents();

View File

@ -1,24 +0,0 @@
#
# Copyright (c) 2018, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
exclusiveAccess.dirs=.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2025, 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
@ -39,9 +39,12 @@
* @library /vmTestbase
* /test/lib
* @build nsk.jvmti.scenarios.allocation.AP12.ap12t001
* @build jdk.test.whitebox.WhiteBox
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
* @run main/othervm/native
* -agentlib:ap12t001=-waittime=5,-verbose
* -XX:-UseGCOverheadLimit
* -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* nsk.jvmti.scenarios.allocation.AP12.ap12t001
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2025, 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
@ -27,6 +27,7 @@ import java.io.PrintStream;
import nsk.share.*;
import nsk.share.jvmti.*;
import jdk.test.whitebox.WhiteBox;
public class em02t002 extends DebugeeClass {
@ -61,7 +62,7 @@ public class em02t002 extends DebugeeClass {
logger.display("generating events");
ClassUnloader.eatMemory();
WhiteBox.getWhiteBox().fullGC();
int currStatus = em02t002.checkStatus(Consts.TEST_PASSED);
if (currStatus != Consts.TEST_PASSED)

View File

@ -1,24 +0,0 @@
#
# Copyright (c) 2018, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
exclusiveAccess.dirs=.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2025, 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
@ -71,9 +71,12 @@
*
* @library /vmTestbase
* /test/lib
* @build jdk.test.whitebox.WhiteBox
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
* @run main/othervm/native
* -agentlib:em02t002=-waittime=5
* -XX:-UseGCOverheadLimit
* -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* nsk.jvmti.scenarios.events.EM02.em02t002
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2025, 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
@ -27,6 +27,7 @@ import java.io.PrintStream;
import nsk.share.*;
import nsk.share.jvmti.*;
import jdk.test.whitebox.WhiteBox;
public class em02t006 extends DebugeeClass {
@ -62,7 +63,7 @@ public class em02t006 extends DebugeeClass {
}
logger.display("ObjectFree:: Provoke JVMTI_EVENT_OBJECT_FREE");
ClassUnloader.eatMemory();
WhiteBox.getWhiteBox().fullGC();
if (checkStatus(Consts.TEST_PASSED) == Consts.TEST_FAILED) {
status = Consts.TEST_FAILED;

View File

@ -1,24 +0,0 @@
#
# Copyright (c) 2018, 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
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
exclusiveAccess.dirs=.

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2025, 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
@ -60,9 +60,12 @@
*
* @library /vmTestbase
* /test/lib
* @build jdk.test.whitebox.WhiteBox
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
* @run main/othervm/native
* -agentlib:em02t006=-waittime=5
* -XX:-UseGCOverheadLimit
* -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
* nsk.jvmti.scenarios.events.EM02.em02t006
*/