GC in MRI 1.9 and REE

Hi all,

While playing with the GC in different ruby implementations i’ve got a
pretty odd situation with MRI GC.

here is the code i’ve used with the results -

If i understand correctly the both implementations(MRI and REE) uses the
same GC strategy - mark and sweep.

The problem is that the MRI is not deallocating objects after the
reference is removed.
I’m not certain is it a bug or I misunderstood some GC concepts.

PS: The allocations are confirmed with vmmap tool so it’s not an live
objects calculation problem.

On Tue, Jan 10, 2012 at 4:51 PM, Alex N. [email protected] wrote:

The problem is that the MRI is not deallocating objects after the
reference is removed.
I’m not certain is it a bug or I misunderstood some GC concepts.

I think it’s in your understanding. :slight_smile: Same strategy does not imply
identical algorithm. Even if both implementation use M&S they still
might have different algorithms to detect liveness of objects. It may
actually make sense to be more conservative about liveness if the
check is faster then. That would result in less objects being
collected.

Bottom line is there are no guarantees as to when an object is
collected. It can long be unreachable before it is actually
collected.

Kind regards

robert

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs