M
Michael Neumann
Hi,
How can I force that the GC frees all unreferenced objects? Basically
what I want is:
x = Object.new
xoid = x.object_id
ObjectSpace.define_finalizer(x, proc { puts "recycled" })
x = nil
ObjectSpace.garbage_collect
puts "after GC"
p ObjectSpace._id2ref(xoid)
What I get is:
before GC
after GC
#<Object....>
recycled
Where I'd have expected:
before GC
recycled
after GC
-> exception RangeError
Any hints?
Regards,
Michael
How can I force that the GC frees all unreferenced objects? Basically
what I want is:
x = Object.new
xoid = x.object_id
ObjectSpace.define_finalizer(x, proc { puts "recycled" })
x = nil
ObjectSpace.garbage_collect
puts "after GC"
p ObjectSpace._id2ref(xoid)
What I get is:
before GC
after GC
#<Object....>
recycled
Where I'd have expected:
before GC
recycled
after GC
-> exception RangeError
Any hints?
Regards,
Michael