...
Code Block | ||
---|---|---|
| ||
$ git hg-export 6df465d # HG changeset patch # User stuefe # Date 1596957602 -7200 # Sun Aug 09:20:02 2020 +0200 8251257: NMT: jcmd VM.native_memory scale=1 crashes target VM Reviewed-by: zgu, dholmes diff --git a/src/hotspot/share/services/nmtCommon.cpp b/src/hotspot/share/services/nmtCommon.cpp index 10a6190d783..b90981f5cd2 100644 --- a/src/hotspot/share/services/nmtCommon.cpp +++ b/src/hotspot/share/services/nmtCommon.cpp @@ -35,6 +35,7 @@ const char* NMTUtil::_memory_type_names[] = { const char* NMTUtil::scale_name(size_t scale) { switch(scale) { + case 1: return ""; case K: return "KB"; case M: return "MB"; case G: return "GB"; diff --git a/test/hotspot/jtreg/runtime/NMT/JcmdScale.java b/test/hotspot/jtreg/runtime/NMT/JcmdScale.java index 12a7f649e02..c0c08be0967 100644 --- a/test/hotspot/jtreg/runtime/NMT/JcmdScale.java +++ b/test/hotspot/jtreg/runtime/NMT/JcmdScale.java @@ -42,6 +42,14 @@ public static void main(String args[]) throws Exception { // Grab my own PID String pid = Long.toString(ProcessTools.getProcessId()); + pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "scale=1"}); + output = new OutputAnalyzer(pb.start()); + output.shouldContain(", committed="); + + pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "scale=b"}); + output = new OutputAnalyzer(pb.start()); + output.shouldContain(", committed="); + pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), pid, "VM.native_memory", "scale=KB"}); output = new OutputAnalyzer(pb.start()); output.shouldContain("KB, committed="); |
Source
Please see See GitHgExport.java.
Overview
Content Tools
ThemeBuilder