< prev index next >

test/hotspot/jtreg/runtime/SharedArchiveFile/DumpSharedDictionary.java

Print this page




  64         } else {
  65             // Grab my own PID
  66             String pid = Long.toString(ProcessTools.getProcessId());
  67 
  68             ProcessBuilder pb = new ProcessBuilder();
  69             pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.systemdictionary"});
  70             OutputAnalyzer output = CDSTestUtils.executeAndLog(pb, "jcmd-systemdictionary");
  71             try {
  72                 output.shouldContain("Shared Dictionary statistics:");
  73                 output.shouldContain("Number of buckets");
  74                 output.shouldContain("Number of entries");
  75                 output.shouldContain("Maximum bucket size");
  76             } catch (RuntimeException e) {
  77                 output.shouldContain("Unknown diagnostic command");
  78             }
  79 
  80             pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.systemdictionary", "-verbose"});
  81             output = CDSTestUtils.executeAndLog(pb, "jcmd-systemdictionary-verbose");
  82             try {
  83                 output.shouldContain("Shared Dictionary");
  84                 output.shouldContain("Dictionary for class loader 0x");
  85                 output.shouldContain("^java.lang.String");
  86             } catch (RuntimeException e) {
  87                 output.shouldContain("Unknown diagnostic command");
  88             }
  89         }
  90     }
  91 }


  64         } else {
  65             // Grab my own PID
  66             String pid = Long.toString(ProcessTools.getProcessId());
  67 
  68             ProcessBuilder pb = new ProcessBuilder();
  69             pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.systemdictionary"});
  70             OutputAnalyzer output = CDSTestUtils.executeAndLog(pb, "jcmd-systemdictionary");
  71             try {
  72                 output.shouldContain("Shared Dictionary statistics:");
  73                 output.shouldContain("Number of buckets");
  74                 output.shouldContain("Number of entries");
  75                 output.shouldContain("Maximum bucket size");
  76             } catch (RuntimeException e) {
  77                 output.shouldContain("Unknown diagnostic command");
  78             }
  79 
  80             pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.systemdictionary", "-verbose"});
  81             output = CDSTestUtils.executeAndLog(pb, "jcmd-systemdictionary-verbose");
  82             try {
  83                 output.shouldContain("Shared Dictionary");
  84                 output.shouldContain("Dictionary for loader data: 0x");
  85                 output.shouldContain("^java.lang.String");
  86             } catch (RuntimeException e) {
  87                 output.shouldContain("Unknown diagnostic command");
  88             }
  89         }
  90     }
  91 }
< prev index next >