Skip to content
This repository has been archived by the owner. It is now read-only.
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 dcb4a8d commit 4a21d0da38067fe85acc65b003e0400a235a6bef
Show file tree
Hide file tree
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=");

0 comments on commit 4a21d0d

Please sign in to comment.