<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;" class="">HeapDumper uses GCCause::_heap_dump as the cause. That looks good to me.<div class=""><br class=""></div><div class="">/Staffan</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 26 jan 2015, at 11:07, Kirk Pepperdine <<a href="mailto:kirk@kodewerk.com" class="">kirk@kodewerk.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=windows-1252" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Staffan,<div class=""><br class=""></div><div class="">There are other entry points in diagnosticCommand that will trigger a Full GC.</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><span style="color: #bb2ca2" class="">void</span> ClassHistogramDCmd::execute(DCmdSource source, TRAPS) {</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">  VM_GC_HeapInspection heapop(output(),</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">                              !_all.value() <span style="color: #008400" class="">/* request full gc if false */</span>);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">  VMThread::execute(&heapop);</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">}</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">and</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><div style="margin: 0px;" class=""><span style="color: #bb2ca2" class="">void</span> HeapDumpDCmd::execute(DCmdSource source, TRAPS) {</div><div style="margin: 0px; color: rgb(0, 132, 0);" class=""><span style="" class="">  </span>// Request a full GC before heap dump if _all is false</div><div style="margin: 0px; color: rgb(0, 132, 0);" class=""><span style="" class="">  </span>// This helps reduces the amount of unreachable objects in the dump</div><div style="margin: 0px; color: rgb(0, 132, 0);" class=""><span style="" class="">  </span>// and makes it easier to browse.</div><div style="margin: 0px;" class="">  HeapDumper dumper(!_all.value() <span style="color: #008400" class="">/* request GC if _all is false*/</span>);</div><div style="margin: 0px;" class="">  <span style="color: #bb2ca2" class="">int</span> res = dumper.dump(_filename.value());</div><div style="margin: 0px;" class="">  <span style="color: #bb2ca2" class="">if</span> (res == <span style="color: #272ad8" class="">0</span>) {</div><div style="margin: 0px;" class="">    output()->print_cr(<span style="color: #d12f1b" class="">"Heap dump file created"</span>);</div><div style="margin: 0px;" class="">  } <span style="color: #bb2ca2" class="">else</span> {</div><div style="margin: 0px; color: rgb(0, 132, 0);" class=""><span style="" class="">    </span>// heap dump failed</div><div style="margin: 0px;" class="">    ResourceMark rm;</div><div style="margin: 0px;" class="">    <span style="color: #bb2ca2" class="">char</span>* error = dumper.error_as_C_string();</div><div style="margin: 0px;" class="">    <span style="color: #bb2ca2" class="">if</span> (error == <span style="color: #bb2ca2" class="">NULL</span>) {</div><div style="margin: 0px; color: rgb(209, 47, 27);" class=""><span style="" class="">      output()->print_cr(</span>"Dump failed - reason unknown"<span style="" class="">);</span></div><div style="margin: 0px;" class="">    } <span style="color: #bb2ca2" class="">else</span> {</div><div style="margin: 0px;" class="">      output()->print_cr(<span style="color: #d12f1b" class="">"%s"</span>, error);</div><div style="margin: 0px;" class="">    }</div><div style="margin: 0px;" class="">  }</div><div style="margin: 0px;" class="">}</div><div style="margin: 0px;" class=""><br class=""></div><div style="margin: 0px;" class="">For example. For consistency, how would you suggest these be handled.</div><div style="margin: 0px;" class=""><br class=""></div><div style="margin: 0px;" class="">Kind regards,</div><div style="margin: 0px;" class="">Kirk Pepperdine</div><div style="margin: 0px;" class=""><br class=""></div></div><div class=""><div class="">On Jan 26, 2015, at 9:12 AM, Staffan Larsen <<a href="mailto:staffan.larsen@oracle.com" class="">staffan.larsen@oracle.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite" class="">A bit of terminology here. ‘GC.run’ is called a ‘Diagnostic Command’. ‘jcmd’ is one way to invoke a Diagnostic Command. Another way is via a JMX MBean. With this in mind I think your references to ‘jcmd’ should be changed to ‘diagnostic command’ (or an abbreviation thereof). For example: _jcmd_gc_run -> _dcmd_gc_run.<br class=""><br class="">Thanks,<br class="">/Staffan<br class=""><br class=""><blockquote type="cite" class="">On 25 jan 2015, at 14:15, Yasumasa Suenaga <<a href="mailto:yasuenag@gmail.com" class="">yasuenag@gmail.com</a>> wrote:<br class=""><br class="">Hi all,<br class=""><br class="">GCCause which is printed in gc log is "System.gc()" when jcmd GC.run is invoked. <br class="">I think that GCCause which is caused by jcmd GC.run should be different from System.gc() . <br class=""><br class="">I uploaded webrev for this enhancement:<br class=""><a href="http://cr.openjdk.java.net/~ysuenaga/JDK-8068589/webrev.00/" class="">http://cr.openjdk.java.net/~ysuenaga/JDK-8068589/webrev.00/</a><br class=""><br class="">This patch prints "jcmd GC.run" to gc log when jcmd GC.run is invoked. <br class=""><br class=""><br class="">Could you review it?<br class=""><br class=""><br class="">Thanks,<br class=""><br class="">Yasumasa<br class=""></blockquote><br class=""></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>