From: Tomas Pospisek's Mailing Lists Date: 2007-10-04T05:12:20+09:00 Subject: Re: [ANN] dike-0.0.1 - a memory leak detector On Tue, 2 Oct 2007, Joel VanderWerf wrote: > Michal Suchanek wrote: >> On 28/09/2007, ara.t.howard 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. It occurs to me: how does conservative GC prevent the heap from filling up with false positive pointers over time? This would represent a "fully automatic memory leak for long running processes"... *t -- ----------------------------------------------------------- Tomas Pospisek http://sourcepole.com - Linux & Open Source Solutions -----------------------------------------------------------