Path: blob/master/test/hotspot/jtreg/vmTestbase/gc/gctests/LargeObjects/large002/TestDescription.java
41161 views
/*1* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/222324/*25* @test26* @key stress randomness27*28* @summary converted from VM Testbase gc/gctests/LargeObjects/large002.29* VM Testbase keywords: [gc, stress, stressopt, nonconcurrent]30* VM Testbase readme:31* DESCRIPTION32* The test checks that Garbage Collector correctly does not throw any33* unexpected exceptions/errors while allocating large objects (classes34* that have more than 65535 fields and classes that have less than 6553535* fields). 65535 of fields is a limitation for JVM (see JVM specification36* Second edition 4.10).37* Since it is impossible to create one class with about 65535 of fields38* (javac cannot compile it), a child class extends a parent class, so the39* fields are devided into two subsets. However, the child class still has40* about 65535 of fields.41* The test starts a number of threads. This number is either set in *.cfg42* file or is calculated by the test itself based on the machine (see43* nsk.share.gc.Algorithms.getThreadsCount() method). As soon as all threads44* are started, each thread begins its checking.45* There are 13 classes to be loaded by each thread. These classes are46* generated by nsk.share.gc.Generator (see its javadoc for more details).47* Each class has a huge number of fields, and the number of fields is more than48* the JVM limitation.49* The test loads the classes with nsk.share.gc.GCClassUnloader class that50* extends nsk.share.ClassUnloader and has a bit different algorith of eating51* heap. As soon as a class is loaded, the test creates an instance of52* it - allocates an object of that type. Then it drops references to the53* class and to the instance and tries to unload the class. The test does not54* expect any exceptions to be thrown.55*56* @library /vmTestbase57* /test/lib58*59* @comment generate and compile nsk.share.gc.newclass.* classes60* @run driver nsk.share.gc.GenClassesBuilder61*62* @run main/othervm63* -XX:-UseGCOverheadLimit64* gc.gctests.LargeObjects.large001.large00165* -largeClassesPath classes66* -isOverLimitFields true67* -aggregationDepth 068* -t 169*/70717273