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 * @summary Test consistency of NMT by creating allocations of the Test type with various sizes and verifying visibility with jcmd
27 * @key nmt jcmd
28 * @library /testlibrary /../../test/lib
29 * @modules java.base/sun.misc
30 * java.management
31 * @build MallocRoundingReportTest
32 * @run main ClassFileInstaller sun.hotspot.WhiteBox
33 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocRoundingReportTest
34 *
35 */
36
37 import com.oracle.java.testlibrary.*;
38
39 import sun.hotspot.WhiteBox;
40
41 public class MallocRoundingReportTest {
42 private static long K = 1024;
43
44 public static void main(String args[]) throws Exception {
45 OutputAnalyzer output;
46 WhiteBox wb = WhiteBox.getWhiteBox();
47
48 // Grab my own PID
49 String pid = Integer.toString(ProcessTools.getProcessId());
50 ProcessBuilder pb = new ProcessBuilder();
51
52 long[] additionalBytes = {0, 1, 512, 650};
53 long[] kByteSize = {1024, 2048};
54 long mallocd_total = 0;
55 for ( int i = 0; i < kByteSize.length; i++)
56 {
57 for (int j = 0; j < (additionalBytes.length); j++) {
|
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 * @summary Test consistency of NMT by creating allocations of the Test type with various sizes and verifying visibility with jcmd
27 * @key nmt jcmd
28 * @library /testlibrary /../../test/lib
29 * @modules java.base/sun.misc
30 * java.management
31 * @build MallocRoundingReportTest
32 * @run main ClassFileInstaller sun.hotspot.WhiteBox
33 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail MallocRoundingReportTest
34 *
35 */
36
37 import jdk.test.lib.*;
38
39 import sun.hotspot.WhiteBox;
40
41 public class MallocRoundingReportTest {
42 private static long K = 1024;
43
44 public static void main(String args[]) throws Exception {
45 OutputAnalyzer output;
46 WhiteBox wb = WhiteBox.getWhiteBox();
47
48 // Grab my own PID
49 String pid = Integer.toString(ProcessTools.getProcessId());
50 ProcessBuilder pb = new ProcessBuilder();
51
52 long[] additionalBytes = {0, 1, 512, 650};
53 long[] kByteSize = {1024, 2048};
54 long mallocd_total = 0;
55 for ( int i = 0; i < kByteSize.length; i++)
56 {
57 for (int j = 0; j < (additionalBytes.length); j++) {
|