I am using active record find_in_batches() on jruby 1.6.8 (which is ruby 1.8.6 I believe). I just do this: self.find_in_batches(attr) {|recs| recs.each { |rec| rec.destroy }} This leaks memory, however some memory looks like it is freed up each time but the memory usage gradually increases, This is a very large set of records. Is it possible that the garbage collector does not have enough time to run ? I tried adding a System.gc() call followed by sleep(2) every now and then, but overall the memory still goes up. Any ideas, suggestions or insights ? thanks <https://lh5.googleusercontent.com/-Vw1m7-hvO24/UMH1VDgTQHI/AAAAAAAAAAM/c7U71V4zi_8/s1600/heap.jpg> -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/jRkt5UFT57QJ. For more options, visit https://groups.google.com/groups/opt_out.