On 01/10/2007, Joel VanderWerf <vjoel / path.berkeley.edu> wrote:
> Michal Suchanek wrote:
> > On 28/09/2007, ara.t.howard <ara.t.howard / gmail.com> wrote:
> >> On Sep 28, 2007, at 11:26 AM, Joel VanderWerf wrote:
> >>
> >>> That looks very useful. I'm not sure "leak" is the term I
> >>> would use, since the objects are reachable. Unused reachable
> >>> objects can be just as much of a problem as unreachable objects, of
> >>> course.
> >>>
> >> agree.  we seem to be the minority though ;-(
> >>
> >
> > Are there any unreachable objects in Ruby? They should be collected
> > and go away eventually. So what I am left with is a gigabyte of
> > reachable objects ... time to optimize space I guess.
>
> Sure there are. Ruby's GC is conservative. If it sees a number on the
> stack that looks like the address of an object, it assumes that the
> number is a pointer (though it could be something else) and it marks the
> object, even though the object might not be reachable. That's expected
> behavior.
>
So if I understand it correctly when I reach the 1G heap size about
half of random numbers on stack appear to be possible object pointers,
right?

Thanks

Michal