RDP16
RDP16

Reputation: 53

Can we rotate GC log based on Specific Time in JDK 8?

I am trying GC log rotation in JDK 8. I have achieved it by using the following GC Log JVM parameter.

-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:verbose-jdk8-gc.log
-XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5
-XX:GCLogFileSize=1k

Additionally to that I want that the GC log rotation should also done based on a given time. Is there any parameter in JVM(JDK 8) so that I can rotate GC log based on a specific time?

Upvotes: 2

Views: 1139

Answers (1)

apangin
apangin

Reputation: 98570

Execute jcmd <PID> GC.rotate_log command from an external scheduler (cron).

Upvotes: 4

Related Questions