hotspot/test/runtime/NMT/NMTWithCDS.java
changeset 30123 7a8b6bd85e24
parent 26297 5f5878285770
child 30146 a5809dde4617
equal deleted inserted replaced
30121:cc43664a0ad7 30123:7a8b6bd85e24
     1 /*
     1 /*
     2  * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    33 public class NMTWithCDS {
    33 public class NMTWithCDS {
    34 
    34 
    35   public static void main(String[] args) throws Exception {
    35   public static void main(String[] args) throws Exception {
    36     ProcessBuilder pb;
    36     ProcessBuilder pb;
    37     pb = ProcessTools.createJavaProcessBuilder(
    37     pb = ProcessTools.createJavaProcessBuilder(
    38         "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:dump");
    38         "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./NMTWithCDS.jsa", "-Xshare:dump");
    39     OutputAnalyzer output = new OutputAnalyzer(pb.start());
    39     OutputAnalyzer output = new OutputAnalyzer(pb.start());
    40     try {
    40     try {
    41       output.shouldContain("Loading classes to share");
    41       output.shouldContain("Loading classes to share");
    42       output.shouldHaveExitValue(0);
    42       output.shouldHaveExitValue(0);
    43 
    43 
    44       pb = ProcessTools.createJavaProcessBuilder(
    44       pb = ProcessTools.createJavaProcessBuilder(
    45         "-XX:+UnlockDiagnosticVMOptions", "-XX:NativeMemoryTracking=detail", "-XX:SharedArchiveFile=./sample.jsa", "-Xshare:on", "-version");
    45         "-XX:+UnlockDiagnosticVMOptions", "-XX:NativeMemoryTracking=detail", "-XX:SharedArchiveFile=./NMTWithCDS.jsa", "-Xshare:on", "-version");
    46       output = new OutputAnalyzer(pb.start());
    46       output = new OutputAnalyzer(pb.start());
    47       output.shouldContain("sharing");
    47       output.shouldContain("sharing");
    48       output.shouldHaveExitValue(0);
    48       output.shouldHaveExitValue(0);
    49 
    49 
    50     } catch (RuntimeException e) {
    50     } catch (RuntimeException e) {