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. |
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 } |