1 /* 2 * Copyright (c) 2017, 2020, Oracle and/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 * @test 27 * @modules java.base/jdk.internal.misc:+open 28 * @key stress gc randomness 29 * 30 * @summary converted from VM Testbase gc/g1/unloading/tests/unloading_anonclassloader_inMemoryCompilation_keep_obj. 31 * VM Testbase keywords: [gc, stress, stressopt, nonconcurrent, javac] 32 * 33 * @modules java.base/jdk.internal.misc 34 * @library /vmTestbase 35 * /test/lib 36 * 37 * @run driver jdk.test.lib.FileInstaller . . 38 * 39 * @comment generate HumongousTemplateClass and compile it to test.classes 40 * @run driver gc.g1.unloading.bytecode.GenClassesBuilder 41 * 42 * @requires vm.gc.G1 43 * @requires vm.opt.ClassUnloading != false 44 * @requires vm.opt.ClassUnloadingWithConcurrentMark != false 45 * @build sun.hotspot.WhiteBox 46 * @run driver ClassFileInstaller sun.hotspot.WhiteBox 47 * @run main/othervm 48 * -Xbootclasspath/a:. 49 * -XX:+UnlockDiagnosticVMOptions 50 * -XX:+WhiteBoxAPI 51 * -XX:+UseG1GC 52 * -XX:+ExplicitGCInvokesConcurrent 53 * -Xlog:gc:gc.log 54 * -XX:-UseGCOverheadLimit 55 * gc.g1.unloading.UnloadingTest 56 * -classloadingMethod anonymous_classloader 57 * -inMemoryCompilation 58 * -keep object 59 * -numberOfChecksLimit 4 60 * -stressTime 180 61 */ 62