Link to home
Start Free TrialLog in
Avatar of wfsoftware
wfsoftware

asked on

GC log rotation question

Hi,

 

So after JDK 1.6.0_34 (as far as I know), java introduced GC log rotation JVM args (see below)

 

-XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=1M

 

    Prior to these JVM arg additions, on any java application start, your GC log would get wiped. In my case a tomcat server running java code.

 

    So now I would assume when these JVM arg's are present, the GC log continues to rotate and not get wiped on application start up. However the above behavior still persists ever after JDK 1.6.0_34 with the new JVM args present.

 

    I should mention while the java application is running, the GC log DOES rotate (i.e., gc_log.txt.0, becomes gc_log.txt.1), but when application is restarted the LAST GC log is erased completely.

This behavior isn't really "log rotation/backup", I've had to introduce my own shell/bat scripts to rotate the latest GC logs manually outside of these JVMargs. I'm not sure if I'm misunderstanding how to use the new JVM args or if oracle doesn't consider this a bug and this is normal behavior.

 

I did file a bug on this, 9005051. However there is no guarantee your bug request ever makes it to the public bug database and oracle doesn't provide reasoning back to the submitter when the bug is rejected or not looked at, so I don't really know what happened with my bug request.

 

If anyone has any insight into this, I would really appreciate it.

 

Thank you!
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

My guess is that your assumption about wiping being normal behaviour is correct
ASKER CERTIFIED SOLUTION
Avatar of wfsoftware
wfsoftware

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wfsoftware
wfsoftware

ASKER

Just making my solution the solution, since oracle won't fix it or even consider reviewing it.