memory usage in jruby with Active record find_in_batches()

27 views
Skip to first unread message

Jedrin

unread,
Dec 7, 2012, 9:03:21 AM12/7/12
to rubyonra...@googlegroups.com







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 



Reply all
Reply to author
Forward
0 new messages