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 nmt jcmd
27 * @summary Sanity check the output of NMT
28 * @library /testlibrary /../../test/lib
29 * @modules java.base/sun.misc
30 * java.management
31 * @build SummarySanityCheck
32 * @run main ClassFileInstaller sun.hotspot.WhiteBox
33 * sun.hotspot.WhiteBox$WhiteBoxPermission
34 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+WhiteBoxAPI SummarySanityCheck
35 */
36
37 import com.oracle.java.testlibrary.*;
38
39 import java.util.regex.Matcher;
40 import java.util.regex.Pattern;
41 import sun.hotspot.WhiteBox;
42
43 public class SummarySanityCheck {
44
45 private static String jcmdout;
46 public static void main(String args[]) throws Exception {
47 // Grab my own PID
48 String pid = Integer.toString(ProcessTools.getProcessId());
49
50 ProcessBuilder pb = new ProcessBuilder();
51
52 // Run 'jcmd <pid> VM.native_memory summary scale=KB'
53 pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary", "scale=KB"});
54 OutputAnalyzer output = new OutputAnalyzer(pb.start());
55
56 jcmdout = output.getOutput();
57 // Split by '-' to get the 'groups'
|
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 nmt jcmd
27 * @summary Sanity check the output of NMT
28 * @library /testlibrary /../../test/lib
29 * @modules java.base/sun.misc
30 * java.management
31 * @build SummarySanityCheck
32 * @run main ClassFileInstaller sun.hotspot.WhiteBox
33 * sun.hotspot.WhiteBox$WhiteBoxPermission
34 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+WhiteBoxAPI SummarySanityCheck
35 */
36
37 import jdk.test.lib.*;
38
39 import java.util.regex.Matcher;
40 import java.util.regex.Pattern;
41 import sun.hotspot.WhiteBox;
42
43 public class SummarySanityCheck {
44
45 private static String jcmdout;
46 public static void main(String args[]) throws Exception {
47 // Grab my own PID
48 String pid = Integer.toString(ProcessTools.getProcessId());
49
50 ProcessBuilder pb = new ProcessBuilder();
51
52 // Run 'jcmd <pid> VM.native_memory summary scale=KB'
53 pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary", "scale=KB"});
54 OutputAnalyzer output = new OutputAnalyzer(pb.start());
55
56 jcmdout = output.getOutput();
57 // Split by '-' to get the 'groups'
|