1 /* |
1 /* |
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 2014, 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. |
24 /* |
24 /* |
25 * @test |
25 * @test |
26 * @key nmt jcmd |
26 * @key nmt jcmd |
27 * @library /testlibrary /testlibrary/whitebox |
27 * @library /testlibrary /testlibrary/whitebox |
28 * @build ThreadedMallocTestType |
28 * @build ThreadedMallocTestType |
|
29 * @ignore |
29 * @run main ClassFileInstaller sun.hotspot.WhiteBox |
30 * @run main ClassFileInstaller sun.hotspot.WhiteBox |
30 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedMallocTestType |
31 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail ThreadedMallocTestType |
31 */ |
32 */ |
32 |
33 |
33 import com.oracle.java.testlibrary.*; |
34 import com.oracle.java.testlibrary.*; |
56 }; |
57 }; |
57 |
58 |
58 allocThread.start(); |
59 allocThread.start(); |
59 allocThread.join(); |
60 allocThread.join(); |
60 |
61 |
61 // Use WB API to ensure that all data has been merged before we continue |
|
62 if (!wb.NMTWaitForDataMerge()) { |
|
63 throw new Exception("Call to WB API NMTWaitForDataMerge() failed"); |
|
64 } |
|
65 |
|
66 // Run 'jcmd <pid> VM.native_memory summary' |
62 // Run 'jcmd <pid> VM.native_memory summary' |
67 pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"}); |
63 pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"}); |
68 output = new OutputAnalyzer(pb.start()); |
64 output = new OutputAnalyzer(pb.start()); |
69 output.shouldContain("Test (reserved=896KB, committed=896KB)"); |
65 output.shouldContain("Test (reserved=896KB, committed=896KB)"); |
70 |
66 |