# HG changeset patch # User iignatyev # Date 1526425678 25200 # Tue May 15 16:07:58 2018 -0700 # Node ID 2298d357aab5d2ded75e95498495f91b4b88a461 # Parent 94a048a97de47a9bc1001281c63671e779a0f502 8202946: [TESTBUG] Open source VM testbase OOM tests Reviewed-by: duke diff --git a/test/hotspot/jtreg/TEST.groups b/test/hotspot/jtreg/TEST.groups --- a/test/hotspot/jtreg/TEST.groups +++ b/test/hotspot/jtreg/TEST.groups @@ -1161,3 +1161,7 @@ vmTestbase/heapdump/JMapHeapCore/TestDescription.java \ vmTestbase/heapdump/JMapMetaspace/TestDescription.java +# Test for OOME re-throwing after Java Heap exchausting +vmTestbase_vm_oom = \ + vmTestbase/vm/oom + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/OOMTraceTest.java b/test/hotspot/jtreg/vmTestbase/vm/oom/OOMTraceTest.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/OOMTraceTest.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2007, 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. + */ +package vm.oom; + +import nsk.share.TestFailure; +import nsk.share.test.*; +import nsk.share.gc.*; +import java.util.List; +import java.util.ArrayList; +import vm.share.stack.StackUtils; + +public abstract class OOMTraceTest extends GCTestBase { + protected abstract OutOfMemoryError createOOM(); + private List expectedTrace = new ArrayList(); + private boolean expectOOM = true; + private Stresser stresser; + + protected void initExpectedTrace() { + addExpectedTraceElement(OOMTraceTest.class.getName(), "run", false); + addExpectedTraceElement(OOMTraceTest.class.getName(), "run1", false); + addExpectedTraceElement(null, "createOOM", false); + } + + protected void addExpectedTraceElement(String className, String methodName, boolean nativeMethod) { + StackUtils.addExpectedTraceElement(expectedTrace, className, methodName, nativeMethod); + } + + /** + * Verify that all elements from expectedTrace occur somewhere + * in the stack trace. + */ + protected void checkExpectedTraceElements(StackTraceElement[] elements) { + try { + if (expectedTrace.size() == 0) + return; + log.info("Expected part of stack trace:"); + StackUtils.printStackTrace(log, expectedTrace); + int i = StackUtils.findMatch(elements, expectedTrace.get(expectedTrace.size() - 1)); + if (i == -1) + throw new TestFailure("Expected element not found: " + StackUtils.strStackTraceElement(expectedTrace.get(0))); + log.info("Found first expected element at index " + i); + StackUtils.checkMatches(elements, expectedTrace, i); + } catch (TestFailure e) { + throw e; + } + } + + protected boolean isAlwaysOOM() { + return expectOOM; + } + + protected void dontExpectOOM() { + expectOOM = false; + } + + protected boolean continueExecution() { + return stresser.continueExecution(); + } + + protected void checkOOM(OutOfMemoryError oom) { + log.info("Checking stack trace."); + StackTraceElement[] elements = oom.getStackTrace(); + log.info("Actual stack trace:"); + StackUtils.printStackTrace(log, elements); + checkExpectedTraceElements(elements); + checkStackTraceElements(elements); + } + + protected void checkStackTraceElements(StackTraceElement[] elements) { + if (elements == null) + throw new TestFailure("OutOfMemoryError has null stack trace"); + if (elements.length == 0) + throw new TestFailure("OutOfMemoryError has stack trace of length 0"); + if (elements.length == 1) + throw new TestFailure("OutOfMemoryError has stack trace of length 1"); + } + + public void run1() { + OutOfMemoryError oom = createOOM(); + if (oom == null) { + if (isAlwaysOOM()) + throw new TestFailure("No OOM is obtained."); + else { + log.info("OOM is not obtained, skipping"); + return; + } + } + log.info("OutOfMemoryError is obtained:"); + log.info(oom); + checkOOM(oom); + log.info("Verification of OOM passed"); + } + + public void run() { + initExpectedTrace(); + + stresser = new Stresser(runParams.getStressOptions()); + stresser.start(runParams.getIterations()); + + while (stresser.iteration()) { + run1(); + } + + stresser.finish(); + + log.info("TEST PASSED"); + } +} diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/README b/test/hotspot/jtreg/vmTestbase/vm/oom/README new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/README @@ -0,0 +1,23 @@ +Copyright (c) 2007, 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. + +Test for OutOfMemoryError. +The tests verify that OutOfMemoryError does have a non-trivial stack trace. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitAnonymousTraceTest.java b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitAnonymousTraceTest.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitAnonymousTraceTest.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2007, 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. + */ +package vm.oom.limit; + +import java.util.*; +import nsk.share.gc.*; +import nsk.share.gc.gp.*; +import nsk.share.TestFailure; +import vm.oom.OOMTraceTest; + +public class OOMLimitAnonymousTraceTest extends OOMTraceTest implements GarbageProducerAware { + + private GarbageProducer garbageProducer; + + private class InnerClassB { + + public void createB() { + Object o = garbageProducer.create(Long.MAX_VALUE); + } + } + + private class InnerClassA { + + public InnerClassA() { + new InnerClassB().createB(); + } + } + + @Override + protected boolean isAlwaysOOM() { + return false; + } + + protected OutOfMemoryError createOOM() { + try { + new InnerClassA(); + return null; + } catch (OutOfMemoryError e) { + return e; + } + } + + protected void initExpectedTrace() { + super.initExpectedTrace(); + addExpectedTraceElement(InnerClassA.class.getName(), "", false); + addExpectedTraceElement(InnerClassB.class.getName(), "createB", false); + addExpectedTraceElement(null, "create", false); + } + + public final void setGarbageProducer(GarbageProducer garbageProducer) { + this.garbageProducer = garbageProducer; + } + + public static void main(String[] args) { + GC.runTest(new OOMLimitAnonymousTraceTest(), args); + } +} diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitAnonymousTrace_Arrays/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitAnonymousTrace_Arrays/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitAnonymousTrace_Arrays/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitAnonymousTrace_Arrays/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitAnonymousTrace_Arrays/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitAnonymousTrace_Arrays/TestDescription.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/limit/OOMLimitAnonymousTrace_Arrays. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Test for OutOfMemoryError obtained by creating an array exceeding VM size limit + * from method of inner class. A random primitive array is used. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm vm.oom.limit.OOMLimitAnonymousTraceTest -gp intArr -iterations 3 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTraceTest.java b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTraceTest.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTraceTest.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2007, 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. + */ +package vm.oom.limit; + +import java.util.*; +import nsk.share.gc.*; +import nsk.share.gc.gp.*; +import nsk.share.TestFailure; +import vm.oom.OOMTraceTest; + +public class OOMLimitTraceTest extends OOMTraceTest implements GarbageProducerAware { + private GarbageProducer garbageProducer; + + protected OutOfMemoryError createOOM() { + try { + Object o = garbageProducer.create(Long.MAX_VALUE); + return null; + } catch (OutOfMemoryError e) { + return e; + } + } + + @Override + protected boolean isAlwaysOOM() { + return false; + } + + protected void initExpectedTrace() { + super.initExpectedTrace(); + addExpectedTraceElement(null, "create", false); + } + + public final void setGarbageProducer(GarbageProducer garbageProducer) { + this.garbageProducer = garbageProducer; + } + + public static void main(String[] args) { + GC.runTest(new OOMLimitTraceTest(), args); + } +} diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_booleanArr/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_booleanArr/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_booleanArr/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_booleanArr/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_booleanArr/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_booleanArr/TestDescription.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/limit/OOMLimitTrace_booleanArr. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Test for OutOfMemoryError obtained by creating boolean array exceeding VM size limit. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm vm.oom.limit.OOMLimitTraceTest -gp booleanArr -iterations 3 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_byteArr/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_byteArr/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_byteArr/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_byteArr/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_byteArr/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_byteArr/TestDescription.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/limit/OOMLimitTrace_byteArr. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Test for OutOfMemoryError obtained by creating byte array exceeding VM size limit. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm vm.oom.limit.OOMLimitTraceTest -gp byteArr -iterations 3 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_charArr/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_charArr/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_charArr/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_charArr/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_charArr/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_charArr/TestDescription.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/limit/OOMLimitTrace_charArr. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Test for OutOfMemoryError obtained by creating char array exceeding VM size limit. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm vm.oom.limit.OOMLimitTraceTest -gp charArr -iterations 3 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_doubleArr/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_doubleArr/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_doubleArr/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_doubleArr/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_doubleArr/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_doubleArr/TestDescription.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/limit/OOMLimitTrace_doubleArr. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Test for OutOfMemoryError obtained by creating double array exceeding VM size limit. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm vm.oom.limit.OOMLimitTraceTest -gp doubleArr -iterations 3 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_floatArr/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_floatArr/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_floatArr/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_floatArr/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_floatArr/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_floatArr/TestDescription.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/limit/OOMLimitTrace_floatArr. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Test for OutOfMemoryError obtained by creating float array exceeding VM size limit. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm vm.oom.limit.OOMLimitTraceTest -gp floatArr -iterations 3 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_intArr/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_intArr/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_intArr/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_intArr/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_intArr/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_intArr/TestDescription.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/limit/OOMLimitTrace_intArr. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Test for OutOfMemoryError obtained by creating int array exceeding VM size limit. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm vm.oom.limit.OOMLimitTraceTest -gp intArr -iterations 3 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_longArr/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_longArr/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_longArr/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_longArr/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_longArr/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_longArr/TestDescription.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/limit/OOMLimitTrace_longArr. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Test for OutOfMemoryError obtained by creating long array exceeding VM size limit. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm vm.oom.limit.OOMLimitTraceTest -gp longArr -iterations 3 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_objectArr/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_objectArr/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_objectArr/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_objectArr/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_objectArr/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_objectArr/TestDescription.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/limit/OOMLimitTrace_objectArr. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Test for OutOfMemoryError obtained by creating object array exceeding VM size limit. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm vm.oom.limit.OOMLimitTraceTest -gp objectArr -iterations 3 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_shortArr/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_shortArr/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_shortArr/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_shortArr/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_shortArr/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/OOMLimitTrace_shortArr/TestDescription.java @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/limit/OOMLimitTrace_shortArr. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Test for OutOfMemoryError obtained by creating short array exceeding VM size limit. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm vm.oom.limit.OOMLimitTraceTest -gp shortArr -iterations 3 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/limit/README b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/README new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/limit/README @@ -0,0 +1,24 @@ +Copyright (c) 2007, 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. + +Tests for OutOfMemoryError obtained from object exceeding VM size limit. +These tests also indirectly verify that the OutOfMemoryError does get +thrown and there are no crashes/hangs. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/AlwaysOOMProductionAnonymousTrace_InternedString/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/production/AlwaysOOMProductionAnonymousTrace_InternedString/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/AlwaysOOMProductionAnonymousTrace_InternedString/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/AlwaysOOMProductionAnonymousTrace_InternedString/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/production/AlwaysOOMProductionAnonymousTrace_InternedString/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/AlwaysOOMProductionAnonymousTrace_InternedString/TestDescription.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/production/AlwaysOOMProductionAnonymousTrace_InternedString. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Tests for OutOfMemoryError obtained from filling memory with + * interned random strings from method of inner class. + * Tests use small limited memory size (128M) and stress time is + * infinite. They fail when OOM is not obtained. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm + * -Xmx128M + * vm.oom.production.OOMProductionAnonymousTraceTest + * -gp interned(randomString) + * -iterations 3 + * -stressTime 0 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/AlwaysOOMProductionTrace_InternedString/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/production/AlwaysOOMProductionTrace_InternedString/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/AlwaysOOMProductionTrace_InternedString/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/AlwaysOOMProductionTrace_InternedString/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/production/AlwaysOOMProductionTrace_InternedString/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/AlwaysOOMProductionTrace_InternedString/TestDescription.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/production/AlwaysOOMProductionTrace_InternedString. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Tests for OutOfMemoryError obtained from filling memory with + * interned random strings. + * Tests use small limited memory size (128M) and stress time is + * infinite. They fail when OOM is not obtained. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm + * -Xmx128M + * vm.oom.production.OOMProductionTraceTest + * -gp interned(randomString) + * -iterations 3 + * -stressTime 0 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTraceTest.java b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTraceTest.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTraceTest.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2007, 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. + */ +package vm.oom.production; + +import java.util.*; +import nsk.share.gc.*; +import nsk.share.gc.gp.*; +import nsk.share.TestFailure; +import vm.oom.OOMTraceTest; + +public class OOMProductionAnonymousTraceTest extends OOMTraceTest implements GarbageProducerAware { + private GarbageProducer garbageProducer; + private long objectSize; + + private class InnerClassB { + public void createB() { + List storage = new ArrayList(); + + while (continueExecution()) { + // the OOM can be thrown at either of the 2 points + // 1. storage.add() + // 2. garbageProducer.create() + // with #2 far more likely, but #1 still possible + storage.add(garbageProducer.create(objectSize)); + } + + dontExpectOOM(); + } + } + + private class InnerClassA { + public InnerClassA() { + new InnerClassB().createB(); + } + } + + protected OutOfMemoryError createOOM() { + try { + objectSize = Runtime.getRuntime().maxMemory() / 50; + new InnerClassA(); + if (isAlwaysOOM()) { + throw new TestFailure("Expected OutOfMemoryError was not thrown"); + } + } catch (OutOfMemoryError e) { + return e; + } + return null; + } + + protected void initExpectedTrace() { + super.initExpectedTrace(); + addExpectedTraceElement(InnerClassA.class.getName(), "", false); + addExpectedTraceElement(InnerClassB.class.getName(), "createB", false); + } + + public final void setGarbageProducer(GarbageProducer garbageProducer) { + this.garbageProducer = garbageProducer; + } + + public static void main(String[] args) { + GC.runTest(new OOMProductionAnonymousTraceTest(), args); + } +} diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_Arrays/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_Arrays/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_Arrays/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_Arrays/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_Arrays/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_Arrays/TestDescription.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/production/OOMProductionAnonymousTrace_Arrays. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Tests for OutOfMemoryError obtained from filling memory with primitive + * arrays from method of inner class. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm + * vm.oom.production.OOMProductionAnonymousTraceTest + * -gp random(arrays) + * -iterations 3 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_Class/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_Class/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_Class/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_Class/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_Class/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_Class/TestDescription.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/production/OOMProductionAnonymousTrace_Class. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm + * -XX:+UnlockDiagnosticVMOptions + * -XX:-VerifyBeforeExit + * vm.oom.production.OOMProductionAnonymousTraceTest + * -gp class + * -iterations 1 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_InternedString/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_InternedString/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_InternedString/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_InternedString/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_InternedString/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionAnonymousTrace_InternedString/TestDescription.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/production/OOMProductionAnonymousTrace_InternedString. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Tests for OutOfMemoryError obtained from filling memory with + * interned random strings from method of inner class. + * Tests can pass without OOM when memory size is huge and stress + * time is small. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm + * vm.oom.production.OOMProductionAnonymousTraceTest + * -gp interned(randomString) + * -iterations 3 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTraceTest.java b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTraceTest.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTraceTest.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2007, 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. + */ +package vm.oom.production; + +import vm.oom.*; +import java.util.*; +import nsk.share.gc.*; +import nsk.share.gc.gp.*; + +public class OOMProductionTraceTest extends OOMTraceTest implements GarbageProducerAware { + private GarbageProducer garbageProducer; + private long objectSize; + + protected OutOfMemoryError createOOM() { + List storage = new ArrayList(); + objectSize = Runtime.getRuntime().maxMemory() / 50; + + try { + while (continueExecution()) { + storage.add(garbageProducer.create(objectSize)); + } + } catch (OutOfMemoryError e) { + return e; + } finally { + storage = null; + } + + dontExpectOOM(); + + return null; + } + + public final void setGarbageProducer(GarbageProducer garbageProducer) { + this.garbageProducer = garbageProducer; + } + + public static void main(String[] args) { + GC.runTest(new OOMProductionTraceTest(), args); + } +} diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_Arrays/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_Arrays/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_Arrays/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_Arrays/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_Arrays/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_Arrays/TestDescription.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/production/OOMProductionTrace_Arrays. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick, quarantine] + * VM Testbase comments: JDK-8068614 + * VM Testbase readme: + * Tests for OutOfMemoryError obtained from filling memory with random + * primitive arrays. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm vm.oom.production.OOMProductionTraceTest -gp random(arrays) -iterations 3 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_Class/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_Class/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_Class/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_Class/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_Class/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_Class/TestDescription.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/production/OOMProductionTrace_Class. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Tests for OutOfMemoryError obtained from filling memory with classes + * loaded by custom classloader. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm vm.oom.production.OOMProductionTraceTest -gp class -iterations 1 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_InternedString/TEST.properties b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_InternedString/TEST.properties new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_InternedString/TEST.properties @@ -0,0 +1,23 @@ +# +# Copyright (c) 2017, 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=. diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_InternedString/TestDescription.java b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_InternedString/TestDescription.java new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/OOMProductionTrace_InternedString/TestDescription.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2017, 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. + */ + + +/* + * @test + * + * @summary converted from VM Testbase vm/oom/production/OOMProductionTrace_InternedString. + * VM Testbase keywords: [feature_oome, nonconcurrent, quick] + * VM Testbase readme: + * Tests for OutOfMemoryError obtained from filling memory with + * interned random strings. + * Tests can pass without OOM when memory size is huge and stress + * time is small. + * + * @library /vmTestbase + * /test/lib + * @run driver jdk.test.lib.FileInstaller . . + * @run main/othervm + * vm.oom.production.OOMProductionTraceTest + * -gp interned(randomString) + * -iterations 3 + */ + diff --git a/test/hotspot/jtreg/vmTestbase/vm/oom/production/README b/test/hotspot/jtreg/vmTestbase/vm/oom/production/README new file mode 100644 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/vm/oom/production/README @@ -0,0 +1,23 @@ +Copyright (c) 2007, 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. + +Tests for OutOfMemoryError obtained from filling memory with objects +of different types.