Skip to content
Permalink
Browse files
8251257: NMT: jcmd VM.native_memory scale=1 crashes target VM
Backport-of: 6df465d
  • Loading branch information
Ekaterina Vergizova authored and Yuri Nesterenko committed Jan 26, 2021
1 parent 0bb1017 commit 614325cdc51e2d859e6d7eb692f80dcef2899507
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";
@@ -43,6 +43,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 614325c

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 614325c Jan 26, 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.