From: ts Date: 2003-01-01T20:57:41+09:00 Subject: Re: [1.8] speed >>>>> "K" == Kero van Gelder writes: K> gc_sweep() got called for each allocation of 100kB, meaning it was ran K> about 100 times more often for 1.7.3 than for 1.6.8. If I change the K> allocation size to 100 bytes (instead of 100 kB) 1.7.3 speeds up to match K> 1.6.8 Well, the problem is easy to understand if you look the source. The patch is described n> * gc.c (ruby_xmalloc, ruby_xrealloc): restrict total allocation n> size according to memories consumed by live objects. n> [ruby-dev:18482] n> * gc.c (gc_sweep): estimate how live objects consume memories. Unfortunately this is wrong : ruby don't estimate the size of *all* objects but only the size of *some* objects (like T_OBJECT, T_ARRAY, ...) it don't even try to correct this value to have a real estimation of the memory, and even if it will try do it it will have a problem. The problem is that ruby has selected a subpopulation and this subpopulation is not representative of all objects. Guy Decoux