Friday 17 August 2018

Java: Target VM does not support GC log file rotation.

You will get this error, when you are trying to trigger 'GC.rotate_log' on a process, but that process is not launched with -XX:+UseGCLogFileRotation option.

C:\>jcmd
6992 HelloWorld
13220
11480 sun.tools.jcmd.JCmd

C:\>jcmd 6992 GC.rotate_log
6992:
Target VM does not support GC log file rotation.

How to resolve the error?
Launch HelloWorld application using below options.
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles
-XX:GCLogFileSize

Example
java -classpath . -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:GCLog -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M HelloWorld

Previous                                                 Next                                                 Home

No comments:

Post a Comment