[Wtr-general] OT: odd memory behavior question

Chris McMahon christopher.mcmahon at gmail.com
Wed Oct 4 21:32:38 EDT 2006


Hi...

I'll probably end up asking this on ruby-talk, but figured I'd start here.

I have a script that load up a ginormous array and then sends it as a
message.  The whole set of data blows out the RAM on the machine it runs
on.  What I want to do is to clear the array every so many records,
repopulate the array with the next set of data, and then send that next
message, over and over.

I have some code like this:

         if send_array.include?(num)
        @result = @soap.sendMessage(ginormous_array)
        ginormous_array = []
      end #if

However, it seems that when I clear the array with "ginormous_array = []",
Ruby doesn't give back the memory it took loading it up in the first place.


Anyone have a suggestion of how to force Ruby to give back the memory for an
array that no longer contains any data?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061004/90ea7113/attachment.html 


More information about the Wtr-general mailing list