I'm having problems with a long-lived background ruby process on our server, which isn't cleaning up Tempfiles. I'm using hijack to inject into the process & inspect things, using, for example,
ObjectSpace.each_object(ActiveRecord::Base){|o| puts o}
- turns out that the Tempfiles in question are being referenced by an instance of one of our ActiveRecord subclasses, and those instances aren't being collected.
I haven't been able to figure out what's referencing those AR instances & keeping them alive. Any tips for getting access to whatever object graph the garbage collector uses?