My application is using gc flag "PrintGCApplicationStoppedTime" but when am running it with Java 9 it is failing with following error:
Unrecognized VM option 'PrintGCApplicationStoppedTime'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
This post indicate that option is deprecated but is there any alternative for the information printed by his flag or this information is no longer available?
Few things to know there:
First, well the answer here by @apangin sums up quite well that the PrintGCApplicationStoppedTime
prints the time spent inside safepoints.
In order to dump more details onto the safe points of your application you shall better make use of:
-XX:+PrintSafepointStatistics -XX:PrintSafepointStatisticsCount=1
Second, Java 9 plans to implement Unified GC logging under JEP#271 which at the same time would make use of the Unified JVM Logging under JEP#158
Going forward with which -Xlog
would be used as a new command-line option to control logging from all components of the JVM. The logging would thereby follow the syntax(quoted):
-Xlog[:option]
option := [<what>][:[<output>][:[<decorators>][:<output-options>]]]
'help'
'disable'
what := <selector>[,...]
selector := <tag-set>[*][=<level>]
tag-set := <tag>[+...]
'all'
tag := name of tag
level := trace
debug
info
warning
error
output := 'stderr'
'stdout'
[file=]<filename>
decorators := <decorator>[,...]
'none'
decorator := time
uptime
timemillis
uptimemillis
timenanos
uptimenanos
pid
tid
level
tags
output-options := <output_option>[,...]
output-option := filecount=<file count>
filesize=<file size in kb>
parameter=value
Where picking up few varied examples to learn from would be:
-Xlog:gc=trace:file=gctrace.txt:uptimemillis,pids:filecount=5,filesize=1024
-Xlog:gc+rt+compiler*=debug,meta*=warning,svc*=off
See also JDK 9 release notes where the implications of unified logging (-Xlog) are detailed: http://jdk.java.net/9/release-notes#JDK-8145092 You'll see that PrintGCApplicationStoppedTime and several options have been removed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With