RFR: 7164841: Improvements to the GC log file rotation

Yumin Qi yumin.qi at oracle.com
Mon Aug 19 20:49:03 UTC 2013

On 8/19/2013 1:20 PM, STIRLING, SCOTT wrote:
> Question about ".current" log: When a JVM re-starts with these args, would it check for existing .current and append to it or just overwrite .current? Needs to append or else the current file contents get blown away.
With the new schema, the file will contain time stamp so the original 
files are never overwrite.
> Regarding:
>> Time stamp is the start of first rotation file created, and all
>> rotation files share the same time stamp in file name.
> I would only tweak it so that the time stamp on all rotation files is set to the time at which each file is created.
> The bug seems to suggest that (to my interpretation) and that would fit with other common log formatting for things like apache.
>  From http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6950794:
> " In this case, the date stamp would correspond to the creation time of each log segment."
This will make the rotation logic more complex --- it will not rotate in 
files, it just create a new file (since timestamp will make file name 
different), and only the number in file names changes, and the number 
of  files always grows. This is not the our intended purpose.  The 
rotation is to limit space usage in disk.

By using the same start time in file name, this clearly gives that those 
logs are in a group which started from " the time". The file time stamps 
will be different since they are the time when they are created.


> Scott Stirling
> AT&T, Boston
> -----Original Message-----
> From: Yumin Qi [mailto:yumin.qi at oracle.com]
> Sent: Monday, August 19, 2013 1:48 PM
> Scott and Yasumasa,
>     Thanks for your information for bug 6950794.
>     According to my current implementation, it is easy to identify which
> file is the current log ---- it ends up with .current appendix. At app
> exit, it did not renamed to other name so still is the last and latest
> log file.
>     I will make modification based on current implementation to cover
> suggestions mentioned  in bug 6950794.
>     This will be only targeted to if gc log file rotations successfully set:
>     Log file name will be <filename>-pid%p-YYYY-MM-DD_HH-MM-SS.%i  which
> p is pid and i be one of 0, ...., n-1. I am not planning to parse
> command line to get those info since they are available internally. Hope
> this will solve the problems mentioned in bug 6950794.
>     So the rotation will be:
>      1) File name,  like mentioned above, example:
> gc.log-pid1234-2013-08-19_08-20-00.1 with
>            -Xloggc:gc.log -XX:+UseGCLogFileRotation
> -XX:NumberOfGCLogFiles=5  -XX:GCLogFileSize=1M
>           Time stamp is the start of first rotation file created, and all
> rotation files share the same time stamp in file name.
>      2) Time stamp of each rotation begings still logged when it is
> started, finished.
>      3) For rotation in same file, the file name will be
> <filename>-pid%p-YYYY-MM-DD_HH-MM-SS
>     Let me know what you think.
> Thanks
> Yumin

More information about the hotspot-gc-dev mailing list