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.


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