开发者

Ruby Mysql - Failed to allocate memory error

开发者 https://www.devze.com 2023-04-07 03:10 出处:网络
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)\".Th

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

0

精彩评论

暂无评论...
验证码 换一张
取 消