< prev index next >

test/hotspot/jtreg/runtime/appcds/javaldr/GCSharedStringsDuringDump.java

Print this page




  84         JarBuilder.build(true, "WhiteBox", "sun/hotspot/WhiteBox");
  85         String whiteBoxJar = TestCommon.getTestJar("WhiteBox.jar");
  86         String bootClassPath = "-Xbootclasspath/a:" + whiteBoxJar;
  87 
  88         for (int i=0; i<2; i++) {
  89             // i = 0 -- run without agent = no extra GCs
  90             // i = 1 -- run with agent = cause extra GCs
  91 
  92             String extraArg = (i == 0) ? "-showversion" : "-javaagent:" + agentJar;
  93 
  94             OutputAnalyzer output = TestCommon.dump(
  95                                 appJar, TestCommon.list("GCSharedStringsDuringDumpWb"),
  96                                 bootClassPath, extraArg, "-Xmx32m", gcLog,
  97                                 "-XX:+UseCompressedOops", "-XX:+UseG1GC",
  98                                 "-XX:SharedReadOnlySize=30m",
  99                                 "-XX:SharedArchiveConfigFile=" + sharedArchiveCfgFile);
 100 
 101             if (output.getStdout().contains("Too many string space regions") ||
 102                 output.getStderr().contains("Unable to write archive heap memory regions") ||
 103                 output.getStdout().contains("Try increasing NewSize") ||

 104                 output.getExitValue() != 0) {
 105                 // Try again with larger heap and NewSize, this should increase the
 106                 // G1 heap region size to 2M
 107                 TestCommon.testDump(
 108                     appJar, TestCommon.list("GCSharedStringsDuringDumpWb"),
 109                     bootClassPath, extraArg, "-Xmx8g", "-XX:NewSize=8m", gcLog,
 110                     "-XX:+UseCompressedOops", "-XX:+UseG1GC",
 111                     "-XX:SharedReadOnlySize=30m",
 112                     "-XX:SharedArchiveConfigFile=" + sharedArchiveCfgFile);
 113             }
 114 
 115             output = TestCommon.execCommon(
 116                 "-cp", appJar,
 117                 bootClassPath,
 118                 "-Xmx32m",
 119                 "-XX:+PrintSharedSpaces",
 120                 "-XX:+UseCompressedOops",
 121                 "-XX:+UseG1GC",
 122                 "-XX:+UnlockDiagnosticVMOptions",
 123                 "-XX:+WhiteBoxAPI",


  84         JarBuilder.build(true, "WhiteBox", "sun/hotspot/WhiteBox");
  85         String whiteBoxJar = TestCommon.getTestJar("WhiteBox.jar");
  86         String bootClassPath = "-Xbootclasspath/a:" + whiteBoxJar;
  87 
  88         for (int i=0; i<2; i++) {
  89             // i = 0 -- run without agent = no extra GCs
  90             // i = 1 -- run with agent = cause extra GCs
  91 
  92             String extraArg = (i == 0) ? "-showversion" : "-javaagent:" + agentJar;
  93 
  94             OutputAnalyzer output = TestCommon.dump(
  95                                 appJar, TestCommon.list("GCSharedStringsDuringDumpWb"),
  96                                 bootClassPath, extraArg, "-Xmx32m", gcLog,
  97                                 "-XX:+UseCompressedOops", "-XX:+UseG1GC",
  98                                 "-XX:SharedReadOnlySize=30m",
  99                                 "-XX:SharedArchiveConfigFile=" + sharedArchiveCfgFile);
 100 
 101             if (output.getStdout().contains("Too many string space regions") ||
 102                 output.getStderr().contains("Unable to write archive heap memory regions") ||
 103                 output.getStdout().contains("Try increasing NewSize") ||
 104                 !output.getStdout().contains("oa0 space:") ||
 105                 output.getExitValue() != 0) {
 106                 // Try again with larger heap and NewSize, this should increase the
 107                 // G1 heap region size to 2M
 108                 TestCommon.testDump(
 109                     appJar, TestCommon.list("GCSharedStringsDuringDumpWb"),
 110                     bootClassPath, extraArg, "-Xmx8g", "-XX:NewSize=8m", gcLog,
 111                     "-XX:+UseCompressedOops", "-XX:+UseG1GC",
 112                     "-XX:SharedReadOnlySize=30m",
 113                     "-XX:SharedArchiveConfigFile=" + sharedArchiveCfgFile);
 114             }
 115 
 116             output = TestCommon.execCommon(
 117                 "-cp", appJar,
 118                 bootClassPath,
 119                 "-Xmx32m",
 120                 "-XX:+PrintSharedSpaces",
 121                 "-XX:+UseCompressedOops",
 122                 "-XX:+UseG1GC",
 123                 "-XX:+UnlockDiagnosticVMOptions",
 124                 "-XX:+WhiteBoxAPI",
< prev index next >