Ruby Mysql - Failed to allocate memory error
I have a large 开发者_C百科MySQL table of about 4 million rows, which I want to process with a ruby script. At the moment, when I run the script I get a "failed to allocate memory (NoMemoryError)". The query runs but the error pops up once I try to loop through the resultset. Can I allocate more memory to the ruby heap space?
Currently, I am thinking of saving the resultset to a large file and the processing that file in chunks.
Any suggestion on an alternative course of action?
Thanks all,
s
精彩评论