Project

General

Profile

Actions

Feature #7022

closed

add event hook for garbage collection

Added by rogerdpack (Roger Pack) about 12 years ago. Updated over 11 years ago.

Status:
Closed
Target version:
[ruby-core:47523]

Description

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.
Thanks.


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #2565: adding hooks for better tracingClosedtenderlovemaking (Aaron Patterson)01/06/2010Actions

Updated by drbrain (Eric Hodel) about 12 years ago

You can't add an event hook for the start of garbage collection. Ruby is out of space for creating the necessary objects.

I think #2565 is a better solution, even though it happens at a lower level.

Also note that there is API for collecting garbage collection and objects pace statistics that can be used for similar purposes.

Updated by rogerdpack (Roger Pack) about 12 years ago

hmm...correct me if I'm wrong (I'm trying to maintain the ruby-prof gem here) will the dtrace probes in #2565 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?

Updated by headius (Charles Nutter) about 12 years ago

I looked into this on JRuby/JVM last night, and found that they have
recently added a nonstandard API for getting GC notifications as they
happen. And they happen after the GC has occurred. They're
informational.

Would be neat to have something standard in Ruby...especially now that
I know we can implement it (on Java 7u4+ anyway).

FWIW, here's a gist I posted last night that implements
GC::Profiler.report entirely in Ruby using the JVM APIs:

https://gist.github.com/3754108

  • Charlie

On Fri, Sep 14, 2012 at 9:13 AM, rogerdpack (Roger Pack)
wrote:

Issue #7022 has been updated by rogerdpack (Roger Pack).

hmm...correct me if I'm wrong (I'm trying to maintain the ruby-prof gem here) will the dtrace probes in #2565 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?

Feature #7022: add event hook for garbage collection
https://bugs.ruby-lang.org/issues/7022#change-29308

Author: rogerdpack (Roger Pack)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:

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.
Thanks.

--
http://bugs.ruby-lang.org/

Updated by mame (Yusuke Endoh) almost 12 years ago

  • Status changed from Open to Assigned
  • Assignee set to authorNari (Narihiro Nakamura)
  • Target version set to 2.6

Updated by Anonymous almost 12 years ago

On 9/20/12, Charles Oliver Nutter wrote:

I looked into this on JRuby/JVM last night, and found that they have
recently added a nonstandard API for getting GC notifications as they
happen. And they happen after the GC has occurred. They're
informational.

Sweet that's what I have been looking for.

Would be neat to have something standard in Ruby...especially now that
I know we can implement it (on Java 7u4+ anyway).

FWIW, here's a gist I posted last night that implements
GC::Profiler.report entirely in Ruby using the JVM APIs:

https://gist.github.com/3754108

It might be interesting to try and integrate the ruby-prof gem more
with native jruby sometime.
Cheers!
-roger-

Updated by authorNari (Narihiro Nakamura) over 11 years ago

  • Status changed from Assigned to Closed

Fixed at r40940.
(ticket is here: https://bugs.ruby-lang.org/issues/8107)

Thank you.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0