< prev index next >

test/hotspot/jtreg/gc/metaspace/TestMetaspaceCMSCancel.java

Print this page




  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 package gc.metaspace;
  25 import jdk.test.lib.process.ProcessTools;
  26 import jdk.test.lib.process.OutputAnalyzer;
  27 import jdk.test.lib.Asserts;
  28 import sun.hotspot.WhiteBox;
  29 
  30 /* @test TestMetaspaceCMSCancel
  31  * @bug 8026752
  32  * @summary Tests cancel of CMS concurrent cycle for Metaspace after a full GC
  33  * @requires !vm.graal.enabled
  34  * @library /test/lib
  35  * @modules java.base/jdk.internal.misc
  36  * @build sun.hotspot.WhiteBox
  37  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  38  * @run main/othervm gc.metaspace.TestMetaspaceCMSCancel
  39  */
  40 
  41 
  42 public class TestMetaspaceCMSCancel {
  43 
  44     public static void main(String[] args) throws Exception {
  45         // Set a small MetaspaceSize so that a CMS concurrent collection will be
  46         // scheduled.  Set CMSWaitDuration to 5s so that the concurrent collection
  47         // start may be delayed.  It does not guarantee 5s before the start of the
  48         // concurrent collection but does increase the probability that it will
  49         // be started later.  System.gc() is used to invoke a full collection.  Set
  50         // ExplicitGCInvokesConcurrent to off so it is a STW collection.
  51         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xbootclasspath/a:.",
  52                                                                   "-XX:+UnlockDiagnosticVMOptions",
  53                                                                   "-XX:+WhiteBoxAPI",


  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 package gc.metaspace;
  25 import jdk.test.lib.process.ProcessTools;
  26 import jdk.test.lib.process.OutputAnalyzer;
  27 import jdk.test.lib.Asserts;
  28 import sun.hotspot.WhiteBox;
  29 
  30 /* @test TestMetaspaceCMSCancel
  31  * @bug 8026752
  32  * @summary Tests cancel of CMS concurrent cycle for Metaspace after a full GC
  33  * @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
  34  * @library /test/lib
  35  * @modules java.base/jdk.internal.misc
  36  * @build sun.hotspot.WhiteBox
  37  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
  38  * @run main/othervm gc.metaspace.TestMetaspaceCMSCancel
  39  */
  40 
  41 
  42 public class TestMetaspaceCMSCancel {
  43 
  44     public static void main(String[] args) throws Exception {
  45         // Set a small MetaspaceSize so that a CMS concurrent collection will be
  46         // scheduled.  Set CMSWaitDuration to 5s so that the concurrent collection
  47         // start may be delayed.  It does not guarantee 5s before the start of the
  48         // concurrent collection but does increase the probability that it will
  49         // be started later.  System.gc() is used to invoke a full collection.  Set
  50         // ExplicitGCInvokesConcurrent to off so it is a STW collection.
  51         ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xbootclasspath/a:.",
  52                                                                   "-XX:+UnlockDiagnosticVMOptions",
  53                                                                   "-XX:+WhiteBoxAPI",
< prev index next >