On Oct 29, 2009, at 12:18 PM, Matthias Neeracher wrote:
#408: leaked Tempfile don't get cleaned up
[...]
Changes (by lsansone...@?):
* status: new => closed
* resolution: => fixed
I implemented ObjectSpace finalizers as part of r2918 and now your
snippet
behaves like the old Ruby.
This does indeed fix the main problem—the program running out of
file descriptors. Thanks!
The behavior still differs significantly from Ruby 1.8 behavior
(though it may match 1.9 this regard): When running the program I
included in the bug to completion, the ruby 1.8 version will clean
up all temp files, while the MacRuby version will leave behind
dozens of temp files (everything created after the last gc run).
Presumably, one could force this cleanup by running gc at the end of
the program, but I'm not sure this would be a popular thing to do in
the runtime, and if it matters to a client, this can be done in
client code.
I think this is a different bug, it looks like we don't force the call
of all finalizers before dying.
$ ./miniruby -e "o=Object.new; ObjectSpace.define_finalizer(o, proc{p
42}); p :dying"
:dying
$ ruby19 -e "o=Object.new; ObjectSpace.define_finalizer(o, proc{p
42}); p :dying"
:dying
42
I remember we trigger a full - synchronous collection before exiting
but apparently it doesn't help.
Could you file a new ticket on Trac for this?
Thanks,
Laurent
_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel