Frederick Cheung wrote:
The details of the query are not important, the significant thing (I
think) is that the the result set is relatively large (~100000 rows
consisting of 3 numbers)
100.000 rows of numbers (actually objects) where each has 20 bytes of
minimum ruby overhead would mean 300.000*20 = 6.000.000 bytes. Possibly
even more since objects may have instance variables. Plus the the memory
allocator has its own overhead too. Also each row is an object in itself.
Think you got it pretty well pinpointed.
While you could try forcing the GC in an after_filter or even better in a
before_filter, the best option would be to create fewer objects at Ruby