test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java

Print this page
rev 7249 : 8062537: [TESTBUG] Conflicting GC combinations in hotspot tests


  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  * @test
  26  * @key gc
  27  * @bug 8049831
  28  * @library /testlibrary /testlibrary/whitebox
  29  * @build TestCMSClassUnloadingEnabledHWM

  30  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  31  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  32  * @run driver TestCMSClassUnloadingEnabledHWM
  33  * @summary Test that -XX:-CMSClassUnloadingEnabled will trigger a Full GC when more than MetaspaceSize metadata is allocated.
  34  */
  35 
  36 import com.oracle.java.testlibrary.OutputAnalyzer;
  37 import com.oracle.java.testlibrary.ProcessTools;
  38 import java.lang.management.GarbageCollectorMXBean;
  39 import java.lang.management.ManagementFactory;
  40 import java.util.ArrayList;
  41 import java.util.Arrays;
  42 import sun.hotspot.WhiteBox;
  43 
  44 public class TestCMSClassUnloadingEnabledHWM {
  45   private static long MetaspaceSize = 32 * 1024 * 1024;
  46   private static long YoungGenSize  = 32 * 1024 * 1024;
  47 
  48   private static OutputAnalyzer run(boolean enableUnloading) throws Exception {
  49     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(




  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  * @test
  26  * @key gc
  27  * @bug 8049831
  28  * @library /testlibrary /testlibrary/whitebox
  29  * @build TestCMSClassUnloadingEnabledHWM
  30  * @requires vm.gc=="ConcMarkSweep" | vm.gc=="null"
  31  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  32  *                              sun.hotspot.WhiteBox$WhiteBoxPermission
  33  * @run driver TestCMSClassUnloadingEnabledHWM
  34  * @summary Test that -XX:-CMSClassUnloadingEnabled will trigger a Full GC when more than MetaspaceSize metadata is allocated.
  35  */
  36 
  37 import com.oracle.java.testlibrary.OutputAnalyzer;
  38 import com.oracle.java.testlibrary.ProcessTools;
  39 import java.lang.management.GarbageCollectorMXBean;
  40 import java.lang.management.ManagementFactory;
  41 import java.util.ArrayList;
  42 import java.util.Arrays;
  43 import sun.hotspot.WhiteBox;
  44 
  45 public class TestCMSClassUnloadingEnabledHWM {
  46   private static long MetaspaceSize = 32 * 1024 * 1024;
  47   private static long YoungGenSize  = 32 * 1024 * 1024;
  48 
  49   private static OutputAnalyzer run(boolean enableUnloading) throws Exception {
  50     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(