<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Yasumasa,<div><br></div><div>Thank you for your review of the code. Indeed you have filed this as a bug and it has been commented on as an enhancement, not a bug. As I have mentioned a single call to System.gc() makes no difference in any analytic that I performed on any application that I’ve encountered in the wild no matter what the cause. Other issues: it’s not currently clear to me that jcmd is the only entry point to this call and that would make the message misleading for those other paths. There are other entry points that can results in a full GC but they will remain labeled as is. I also see a downstream impact on tooling. Thus I don’t see a compelling argument for the value of this change thus I will argue towards not destabilizing downstream tooling.</div><div><br></div><div>That said, I’ve said my piece and have added enough spam to the list on this subject.</div><div><br></div><div>Kind regards,</div><div>Kirk Pepperdine</div><div><br></div><div><br><div><div>On Jan 26, 2015, at 4:53 AM, Yasumasa Suenaga <<a href="mailto:yasuenag@gmail.com">yasuenag@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><p dir="ltr">Hi Kirk,</p><p dir="ltr">I want to distinguish GC whether it is requested from internal (e.g. System.gc()) or not.<br>
System.gc() is called in RMI as you said. </p><p dir="ltr">In JVM implementation, entry point of GC is Universe::heap()->collect() family. It is used by JVMTI force GC, heap inspection (e.g. jmap), etc. Thus I guess that GCCause which is invoked from JVM should set valid GCCause which is not System.gc().<br>
So I file this enhancement to JBS and create a patch.<br></p><p dir="ltr">Thanks,</p><p dir="ltr">Yasumasa</p>
<div class="gmail_quote">2015/01/26 6:14 "Kirk Pepperdine" <<a href="mailto:kirk@kodewerk.com">kirk@kodewerk.com</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto;">Hi Yasumasa,<br>
<br>
<br>
><br>
> I think the System.gc() call which is invoked by jcmd is special case and I want to<br>
> distinguish it.<br>
> Programmer can call System.gc() from their code. But GC which is invoked by jcmd is NOT explicitly call by programmer.<br>
<br>
System.gc() called for by RMI is also not explicitly called by the programmer either. There are also other tools that will result in calls to System.gc() also. Should we catalog them in GCCause also?<br>
<br>
><br>
> Indeed, SystemGCDCmd will call System.gc() (same meaning).<br>
> However, I think it has different meaning from System.gc() call from source code.<br>
<br>
I’m not sure I understand the point. From an analytical POV, a single call to System.gc() is pretty much meaningless. If it’s regular or there is a pattern in the frequency of the calls then I’m interested. A call to System.gc() has the same effect no matter who or why is responsible.<br>
<br>
My interest lies in keeping the GC logs as simple as possible. If there is meaningful data to add so be it. That said, I’m not sure that this change meets that bar.<br>
<br>
That said, I’m still concerned that the caller/callee division seems inside out. But it’s Sunday so…<br>
<br>
Kind regards,<br>
Kirk Pepperdine<br>
<br>
><br>
><br>
> Thanks,<br>
><br>
> Yasumasa<br>
><br>
><br>
> On 2015/01/25 22:56, Kirk Pepperdine wrote:<br>
>> Hi,<br>
>><br>
>> IMHO, if a System.gc() is being called then the cause should be System.gc(). If we start down the road of differentiating between the various causes of calls to System.gc() this will turn in a nightmare!<br>
>><br>
>> Indeed as I look at the patch it’s curious that it’s up to the caller to determine is calls to System.gc() have been suppressed. I would have expected the collect() call to make the decision as to should the call be honored or not.<br>
>><br>
>>  void SystemGCDCmd::execute(DCmdSource source, TRAPS) {<br>
>>    if (!DisableExplicitGC) {<br>
>>     Universe::heap()->collect(GCCause::_jcmd_gc_run);<br>
>>    } else {<br>
>>      output()->print_cr("Explicit GC is disabled, no GC has been performed.");<br>
>>    }<br>
>><br>
>><br>
>><br>
>> Kind regards,<br>
>> Kirk Pepperdine<br>
>><br>
>> On Jan 25, 2015, at 2:15 PM, Yasumasa Suenaga <<a href="mailto:yasuenag@gmail.com">yasuenag@gmail.com</a> <mailto:<a href="mailto:yasuenag@gmail.com">yasuenag@gmail.com</a>>> wrote:<br>
>><br>
>>> Hi all,<br>
>>><br>
>>> GCCause which is printed in gc log is "System.gc()" when jcmd GC.run is invoked.<br>
>>> I think that GCCause which is caused by jcmd GC.run should be different from System.gc() .<br>
>>><br>
>>> I uploaded webrev for this enhancement:<br>
>>> <a href="http://cr.openjdk.java.net/~ysuenaga/JDK-8068589/webrev.00/" target="_blank">http://cr.openjdk.java.net/~ysuenaga/JDK-8068589/webrev.00/</a><br>
>>><br>
>>> This patch prints "jcmd GC.run" to gc log when jcmd GC.run is invoked.<br>
>>><br>
>>><br>
>>> Could you review it?<br>
>>><br>
>>><br>
>>> Thanks,<br>
>>><br>
>>> Yasumasa<br>
>><br>
<br>
</blockquote></div>
</blockquote></div><br></div></body></html>