GC log rotation question



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!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

My guess is that your assumption about wiping being normal behaviour is correct
wfsoftwareAuthor Commented:
Oracle has no interest in my question, https://forums.oracle.com/thread/2569716

So I've given up trying to solve it, I could go look at src, and solve it. But I'd rather not create a custom jdk implementation just to fix a bug (well I think its a bug) that is about GC logs being overwritten.

I'll close this one, thanks for the responses!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wfsoftwareAuthor Commented:
Just making my solution the solution, since oracle won't fix it or even consider reviewing it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.