Skip to content
Permalink
Browse files
8251257: NMT: jcmd VM.native_memory scale=1 crashes target VM
Reviewed-by: zgu, dholmes
  • Loading branch information
tstuefe committed Aug 9, 2020
1 parent b5d775f commit 6df465de7309e90bc4de8da66c7059035ffc9bef
Showing with 9 additions and 0 deletions.
  1. +1 −0 src/hotspot/share/services/nmtCommon.cpp
  2. +8 −0 test/hotspot/jtreg/runtime/NMT/JcmdScale.java
@@ -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";
@@ -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=");

0 comments on commit 6df465d

Please sign in to comment.