Mercurial > hg > truffle
comparison test/runtime/NMT/SummaryAfterShutdown.java @ 20361:ac12996df59b
8044140: Create NMT (Native Memory Tracking) tests for NMT2
Summary: Create new/modify existing tests for NMT2, which is an internal redesign to address scalability issues in the first implementation.
Reviewed-by: ctornqvi, zgu
Contributed-by: George Triantafillou <george.triantafillou@oracle.com>
author | zgu |
---|---|
date | Wed, 27 Aug 2014 08:35:03 -0400 |
parents | 879c6de913d6 |
children | 6640f982c1be |
comparison
equal
deleted
inserted
replaced
20360:833b0f92429a | 20361:ac12996df59b |
---|---|
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 * @summary Verify that jcmd correctly reports that NMT is not enabled after a shutdown | 27 * @summary Verify that jcmd correctly reports that NMT is not enabled after a shutdown |
28 * @library /testlibrary | 28 * @library /testlibrary |
29 * @ignore | |
29 * @run main/othervm -XX:NativeMemoryTracking=detail SummaryAfterShutdown | 30 * @run main/othervm -XX:NativeMemoryTracking=detail SummaryAfterShutdown |
30 */ | 31 */ |
31 | 32 |
32 import com.oracle.java.testlibrary.*; | 33 import com.oracle.java.testlibrary.*; |
33 | 34 |
42 // Run 'jcmd <pid> VM.native_memory shutdown' | 43 // Run 'jcmd <pid> VM.native_memory shutdown' |
43 pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "shutdown"}); | 44 pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "shutdown"}); |
44 output = new OutputAnalyzer(pb.start()); | 45 output = new OutputAnalyzer(pb.start()); |
45 | 46 |
46 // Verify that jcmd reports that NMT is shutting down | 47 // Verify that jcmd reports that NMT is shutting down |
47 output.shouldContain("Shutdown is in progress, it will take a few moments to completely shutdown"); | 48 output.shouldContain("Native memory tracking has been turned off"); |
48 | 49 |
49 // Run 'jcmd <pid> VM.native_memory summary' | 50 // Run 'jcmd <pid> VM.native_memory summary' |
50 pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"}); | 51 pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "summary"}); |
51 output = new OutputAnalyzer(pb.start()); | 52 output = new OutputAnalyzer(pb.start()); |
52 | 53 |
53 // Verify that jcmd reports that NMT has been shutdown | 54 // Verify that jcmd reports that NMT has been shutdown |
54 output.shouldContain("Native memory tracking has been shutdown by user"); | 55 output.shouldContain("Native memory tracking has been shutdown"); |
55 } | 56 } |
56 } | 57 } |