From: ts Date: 2001-10-02T21:37:00+09:00 Subject: [ruby-talk:21939] [1.7] Enumerable#sort_by I must say that I don't understand the line 238 of enum.c 224 static VALUE 225 enum_sort_by(obj) 226 VALUE obj; 227 { 228 VALUE ary = rb_ary_new(); 229 NODE *memo = rb_node_newnode(NODE_MEMO, ary, 0, 0); 230 long i; 231 232 rb_iterate(rb_each, obj, sort_by_i, (VALUE)memo); 233 rb_gc_force_recycle((VALUE)memo); 234 rb_iterate(rb_ary_sort_bang, ary, sort_by_sort_body, 0); 235 for (i=0; ilen; i++) { 236 VALUE e = RARRAY(ary)->ptr[i]; 237 RARRAY(ary)->ptr[i] = rb_ary_entry(e, 2); 238 rb_gc_force_recycle(e); 239 } 240 241 return ary; 242 } If I'm right (3 * VALUE) are never free An example to see it pigeon% cat b.rb #!./ruby a = [3, 4, 2, 7, 19] system "ps aux | head -1" 2000.times do |i| system "ps aux | grep b.rb | grep -v grep" if (i % 20) == 0 a.sort_by {|m| -m} end pigeon% Guy Decoux