/** *TestspawnsMixedGCProvokerinaseparateVMandexpectstofindamessage *tellingthatamixedgchashappened
*/ publicclass TestLogging { privatestaticfinal String[] COMMON_OPTIONS = new String[]{ "-Xbootclasspath/a:.", "-XX:+UseG1GC", "-XX:+UnlockExperimentalVMOptions", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-Xms10M", "-Xmx10M", "-XX:NewSize=2M", "-XX:MaxNewSize=2M", "-XX:+AlwaysTenure", // surviving promote objects immediately "-XX:InitiatingHeapOccupancyPercent=100", // set initial CMC threshold and disable adaptive IHOP "-XX:-G1UseAdaptiveIHOP", // to avoid additional concurrent cycles caused by ergonomics "-XX:G1MixedGCCountTarget=4", "-XX:MaxGCPauseMillis=30000", // to have enough time "-XX:G1HeapRegionSize=1m", "-XX:G1HeapWastePercent=0", "-XX:G1MixedGCLiveThresholdPercent=100"};
publicstaticvoid main(String args[]) throws Exception { // Test turns logging on by giving -Xlog:gc flag
test("-Xlog:gc,gc+heap=debug"); // Test turns logging on by giving -Xlog:gc=debug flag
test("-Xlog:gc=debug,gc+heap=debug");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.