RFR: 8025856 - Fix typos in the GC code

Bengt Rutisson bengt.rutisson at oracle.com
Mon Oct 14 06:43:38 UTC 2013


Hi Kirk,

On 10/13/13 10:59 PM, Kirk Pepperdine wrote:
> Hi Bengt,
>
>
>>> Hi,
>>>
>>> In gcCause.cpp I have this...
>>>
>>>      case _java_lang_system_gc:
>>>        return "System.gc()";
>>>
>>> This use to simply be System. Again, the arbitrary change does create added parsing difficulties when dealing with different versions of GC logs. Can I request that this string be reverted back to "System" ?
>> This code has been the same since revision 0:
>>
>> http://hg.openjdk.java.net/hsx/hotspot-gc/hotspot/annotate/f2110083203d/src/share/vm/gc_interface/gcCause.cpp
>>
>> So, to avoid the kind of log parsing issues that you mention I suggestion that we don't change this now.
>>
>> I think you are referring to the fact that until a change that was made 1.5 years ago the collectors were not consistent in how they logged the GC cause when the GC was started by a call to System.gc(). The ParallelGC logged just System while the others logged System.gc(). Now that all collectors use the GC cause string they are all consistent, which I think should make parsing the logs simpler not more difficult.
> Sorry but I've yet to see a System.gc() logged in the dozens upon dozens of GC logs that I've collected over the last 1.5 years. However, I've plenty that say "System". Add in that OpenJDK on OSX seems to be logging differently and quite frankly these seemingly little insignificant changes add up to a huge mess. Given that in the field we have to deal with logs from all versions of JVMs I would say that the norm in the field is "System". As such I would strongly prefer *not* to continue with "System.gc()". And best of all, it's 5 bytes shorter while conveying the same information. I think it's best that this little change can be made before 8 is released when cause will be printed by default.

A couple of comments:

* The logging is now consistent with all collectors.
* The logging is now consistent with other tools that use the GC cause, 
such as j* commands, MBeans and event tracing.
* The name System is not very informative. It does not really explain 
what happened. System.gc() is a well know concept for Java users.
* The current log statements are present in 7u-releases and will be 
present the JDK8 release.

I strongly suggest that we keep the current behavior.

Bengt

>
> I'm happy to supply the patch.
>
> Regards,
> Kirk
>




More information about the hotspot-gc-dev mailing list