From: Roger Pack Date: 2007-11-11T14:45:28+09:00 Subject: Re: JRuby performance questions answered > I'm not sure on this one. Given that a compacting collector needs > several times as much RAM available as in use to be efficient, and that > a reference-counting collector probably gives no more fragmentation than > malloc, it's hard to say which way locality would go. No joke sometimes I agree and malloc is just 'good enough' :) > The traditional objection to reference counting is that you spend a lot > of time adjusting reference counts. But with CPUs are so much faster > than RAM nowadays, that may matter less. Anyways, for more than you > ever wanted to know about GC, here's a slightly-dated but still > excellent survey paper: > > ftp://ftp.cs.utexas.edu/pub/garbage/bigsurv.ps Thank you. I've wondered about this, myself, as, to my limited knowledge, a generational GC would need to 'alias' everything that's allocated (so it could move them to different generations), which would involve a memory redirection. I could be wrong. If so then that's a drawback to it. Whereas for RC, like you said, the objects themselves are already in cache, so the cpu can inc them quickly, and, IMO in the lifetime of an object, how many times is it going to be inc'ed? Maybe a few times plus once per scope change where it is assigned? Seems not too often, as typically few objects are within a given scope, AFAIK--maybe class variables and local variables. I would imagine that the counts aren't changed all that much, and, if they are, at least it's not changing the counts on all objects in memory (like mark and sweep), and it spreads the GC over time instead of huge show stoppers. Just my latest $.02 spouting off steam. Have a good evening. -Roger -- Posted via http://www.ruby-forum.com/.