Forum: Ruby-core [ruby-trunk - Feature #7022][Open] add event hook for garbage collection

Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2012-09-14 08:32
(Received via mailing list)
Issue #7022 has been reported by rogerdpack (Roger Pack).

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

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.
58479f76374a3ba3c69b9804163f39f4?d=identicon&s=25 drbrain (Eric Hodel) (Guest)
on 2012-09-14 10:15
(Received via mailing list)
Issue #7022 has been updated by drbrain (Eric Hodel).


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.
----------------------------------------
Feature #7022: add event hook for garbage collection
https://bugs.ruby-lang.org/issues/7022#change-29299

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.
Bec38d63650c8912b6ba9b557fb953b9?d=identicon&s=25 Roger Pack (rogerdpack)
on 2012-09-14 18:14
(Received via mailing list)
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.
F1d37642fdaa1662ff46e4c65731e9ab?d=identicon&s=25 Charles Nutter (headius)
on 2012-09-20 23:25
(Received via mailing list)
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)
F24ff61beb80aa5f13371aa22a35619c?d=identicon&s=25 mame (Yusuke Endoh) (Guest)
on 2012-11-20 15:30
(Received via mailing list)
Issue #7022 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned
Assignee set to authorNari (Narihiro Nakamura)
Target version set to next minor


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

Author: rogerdpack (Roger Pack)
Status: Assigned
Priority: Normal
Assignee: authorNari (Narihiro Nakamura)
Category:
Target version: next minor


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.
947c97a2c119e85989d2ca63135a5b5e?d=identicon&s=25 Roger Pack (Guest)
on 2013-01-10 15:29
(Received via mailing list)
On 9/20/12, Charles Oliver Nutter <headius@headius.com> 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-
9f859654c118bcd2f67cc763baf0de7a?d=identicon&s=25 authorNari (Narihiro Nakamura) (Guest)
on 2013-06-05 04:29
(Received via mailing list)
Issue #7022 has been updated by authorNari (Narihiro Nakamura).

Status changed from Assigned to Closed

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

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

Author: rogerdpack (Roger Pack)
Status: Closed
Priority: Normal
Assignee: authorNari (Narihiro Nakamura)
Category:
Target version: next minor


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.
This topic is locked and can not be replied to.