Anyone have a suggestion of how to force Ruby to give back the memory for an array that no longer contains any data?  


You need to run the garbage collector. It is something like this:

  GC.start

You also need to make sure that you don't retain any references to any bits of the array. Assign them to nil, or better, ensure they are out of scope.

This is good to know.  However, I didn't have to resort to using it.  Running the process overnight, reloading ginormous_array 5 times, it seems that Ruby is re-using a lot of this memory.  My Ruby process is still holding on to a lot of memory, but not nearly as much as loading the whole set of data into a single array. 


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to