tags:

views:

43

answers:

1

Is it possible to configure Sun gc logging (JRE 1.6.0) with a rotating gc log. currently I use the following hotspot options for logging:

-XX:+PrintGCTimeStamps -verbose:gc -Xloggc:/gc.log -XX:+PrintGCDetails

gc.log increases very fast and therefore I'd prefer to have a rolling one.

A: 

I don't believe that this is currently possible.

There are proposals to make this possible in the future (specifically with things like target file size and archive count before deleting old files), but for the moment you're left with one file per process.

If your gc log file is filling up quickly, you may want to see why and tune the VM accordingly to reduce memory pressure. You shouldn't expect your program to spend inordinate amounts of time in gc, unless you're doing crazy things on purpose!

Joe Kearney