< prev index next >
test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest02.java
Print this page
rev 50964 : 8207067: [test] prevent timeouts in serviceability/tmtools/jstat/{GcTest02,GcCauseTest02}.java
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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.
@@ -30,15 +30,34 @@
* @requires vm.opt.ExplicitGCInvokesConcurrent != true
* @requires vm.gc != "Z"
* @modules java.base/jdk.internal.misc
* @library /test/lib
* @library ../share
- * @run main/othervm -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcCauseTest02
+ * @build sun.hotspot.WhiteBox
+ * @run driver ClassFileInstaller sun.hotspot.WhiteBox
+ * sun.hotspot.WhiteBox$WhiteBoxPermission
+ * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
+ -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcCauseTest02
*/
import utils.*;
+import sun.hotspot.WhiteBox;
public class GcCauseTest02 {
public static void main(String[] args) throws Exception {
+ // This test produces more than 90_000 classes until it eats up ~70% of the 128M meta space.
+ // The loading of each of these classes triggers a full dependency check for ALL nmethods
+ // in debug/fastdebug builds because 'VerifyDependencies' is 'true' there. This slows down the
+ // test from about 3 sec. in the opt to about 88 sec. in the fastdebug build on x86_64 and from
+ // about 4 sec. to about 560 sec. on ppc64.
+ // Because this test is not about dependency checking, it makes sense to switch of
+ // 'VerifyDependencies' if it is run inside a debug/fastdebug VM and decrease the execution time
+ // down to about 6 sec. on both x86_64 and ppc64.
+ WhiteBox wb = WhiteBox.getWhiteBox();
+ if (!wb.isConstantVMFlag("VerifyDependencies")) {
+ // "VerifyDependencies" is a "development" flag (i.e. it is constant in a product build) so
+ // '!wb.isConstantVMFlag("VerifyDependencies")' means that we run inside a debug/fastdebug VM.
+ wb.setBooleanVMFlag("VerifyDependencies", false);
+ }
new GarbageProducerTest(new JstatGcCauseTool(ProcessHandle.current().pid())).run();
}
}
< prev index next >