Skip to content
Permalink
Browse files
8251257: NMT: jcmd VM.native_memory scale=1 crashes target VM
Backport-of: 6df465de7309e90bc4de8da66c7059035ffc9bef
  • Loading branch information
Ekaterina Vergizova committed May 17, 2021
1 parent fb53967 commit 723da963557c23713cc5ae0fcbd6d8d0cfb77d67
Showing 2 changed files with 9 additions and 0 deletions.
@@ -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=");

1 comment on commit 723da96

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 723da96 May 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.