https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112012-09-14T17:15:09ZRuby Issue Tracking SystemRuby master - Feature #7022: add event hook for garbage collectionhttps://bugs.ruby-lang.org/issues/7022?journal_id=292992012-09-14T17:15:09Zdrbrain (Eric Hodel)drbrain@segment7.net
<ul></ul><p>You can't add an event hook for the start of garbage collection. Ruby is out of space for creating the necessary objects.</p>
<p>I think <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: adding hooks for better tracing (Closed)" href="https://bugs.ruby-lang.org/issues/2565">#2565</a> is a better solution, even though it happens at a lower level.</p>
<p>Also note that there is API for collecting garbage collection and objects pace statistics that can be used for similar purposes.</p> Ruby master - Feature #7022: add event hook for garbage collectionhttps://bugs.ruby-lang.org/issues/7022?journal_id=293082012-09-15T01:13:42Zrogerdpack (Roger Pack)rogerpack2005@gmail.com
<ul></ul><p>hmm...correct me if I'm wrong (I'm trying to maintain the ruby-prof gem here) will the dtrace probes in <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: adding hooks for better tracing (Closed)" href="https://bugs.ruby-lang.org/issues/2565">#2565</a> help me if I'm running profiling in windows? Actually if a hook were added for "GC DONE" or the like, I could query using the API at that point, which would probably be enough. Feedbacks?</p> Ruby master - Feature #7022: add event hook for garbage collectionhttps://bugs.ruby-lang.org/issues/7022?journal_id=296282012-09-21T06:29:14Zheadius (Charles Nutter)headius@headius.com
<ul></ul><p>I looked into this on JRuby/JVM last night, and found that they have<br>
recently added a nonstandard API for getting GC notifications as they<br>
happen. And they happen <em>after</em> the GC has occurred. They're<br>
informational.</p>
<p>Would be neat to have something standard in Ruby...especially now that<br>
I know we can implement it (on Java 7u4+ anyway).</p>
<p>FWIW, here's a gist I posted last night that implements<br>
GC::Profiler.report entirely in Ruby using the JVM APIs:</p>
<p><a href="https://gist.github.com/3754108" class="external">https://gist.github.com/3754108</a></p>
<ul>
<li>Charlie</li>
</ul>
<p>On Fri, Sep 14, 2012 at 9:13 AM, rogerdpack (Roger Pack)<br>
<a href="mailto:rogerpack2005@gmail.com" class="email">rogerpack2005@gmail.com</a> wrote:</p>
<blockquote>
<p>Issue <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: add event hook for garbage collection (Closed)" href="https://bugs.ruby-lang.org/issues/7022">#7022</a> has been updated by rogerdpack (Roger Pack).</p>
<a name="hmmcorrect-me-if-Im-wrong-Im-trying-to-maintain-the-ruby-prof-gem-here-will-the-dtrace-probes-in-2565-help-me-if-Im-running-profiling-in-windows-Actually-if-a-hook-were-added-for-GC-DONE-or-the-like-I-could-query-using-the-API-at-that-point-which-would-probably-be-enough-Feedbacks"></a>
<h2 >hmm...correct me if I'm wrong (I'm trying to maintain the ruby-prof gem here) will the dtrace probes in <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: adding hooks for better tracing (Closed)" href="https://bugs.ruby-lang.org/issues/2565">#2565</a> help me if I'm running profiling in windows? Actually if a hook were added for "GC DONE" or the like, I could query using the API at that point, which would probably be enough. Feedbacks?<a href="#hmmcorrect-me-if-Im-wrong-Im-trying-to-maintain-the-ruby-prof-gem-here-will-the-dtrace-probes-in-2565-help-me-if-Im-running-profiling-in-windows-Actually-if-a-hook-were-added-for-GC-DONE-or-the-like-I-could-query-using-the-API-at-that-point-which-would-probably-be-enough-Feedbacks" class="wiki-anchor">¶</a></h2>
<p>Feature <a class="issue tracker-2 status-5 priority-4 priority-default closed" title="Feature: add event hook for garbage collection (Closed)" href="https://bugs.ruby-lang.org/issues/7022">#7022</a>: add event hook for garbage collection<br>
<a href="https://bugs.ruby-lang.org/issues/7022#change-29308" class="external">https://bugs.ruby-lang.org/issues/7022#change-29308</a></p>
<p>Author: rogerdpack (Roger Pack)<br>
Status: Open<br>
Priority: Normal<br>
Assignee:<br>
Category:<br>
Target version:</p>
<p>It would be useful for profilers to have more insight into garbage collection. Feature request: add event hooks for garbage collect start/stop. For the lazy sweep, start and stop events would also be interesting.<br>
Thanks.</p>
<p>--<br>
<a href="http://bugs.ruby-lang.org/" class="external">http://bugs.ruby-lang.org/</a></p>
</blockquote> Ruby master - Feature #7022: add event hook for garbage collectionhttps://bugs.ruby-lang.org/issues/7022?journal_id=333342012-11-20T23:28:59Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>authorNari (Narihiro Nakamura)</i></li><li><strong>Target version</strong> set to <i>2.6</i></li></ul> Ruby master - Feature #7022: add event hook for garbage collectionhttps://bugs.ruby-lang.org/issues/7022?journal_id=353292013-01-10T23:29:18ZAnonymous
<ul></ul><p>On 9/20/12, Charles Oliver Nutter <a href="mailto:headius@headius.com" class="email">headius@headius.com</a> wrote:</p>
<blockquote>
<p>I looked into this on JRuby/JVM last night, and found that they have<br>
recently added a nonstandard API for getting GC notifications as they<br>
happen. And they happen <em>after</em> the GC has occurred. They're<br>
informational.</p>
</blockquote>
<p>Sweet that's what I have been looking for.</p>
<blockquote>
<p>Would be neat to have something standard in Ruby...especially now that<br>
I know we can implement it (on Java 7u4+ anyway).</p>
<p>FWIW, here's a gist I posted last night that implements<br>
GC::Profiler.report entirely in Ruby using the JVM APIs:</p>
<p><a href="https://gist.github.com/3754108" class="external">https://gist.github.com/3754108</a></p>
</blockquote>
<p>It might be interesting to try and integrate the ruby-prof gem more<br>
with native jruby sometime.<br>
Cheers!<br>
-roger-</p> Ruby master - Feature #7022: add event hook for garbage collectionhttps://bugs.ruby-lang.org/issues/7022?journal_id=397122013-06-05T11:27:33ZauthorNari (Narihiro Nakamura)authorNari@gmail.com
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li></ul><p>Fixed at r40940.<br>
(ticket is here: <a href="https://bugs.ruby-lang.org/issues/8107" class="external">https://bugs.ruby-lang.org/issues/8107</a>)</p>
<p>Thank you.</p>