ruby on rails - rake task memory leak -


Do I have the work of a long-running rack that tilts my system memory over time? What is the fastest way to track my problem and reach out to it?

I am using Ubuntu on Rails 2.3.5, Ruby 1.8.7, SliceHost and MyScl 5.

I have a rail app that works fine I have a night job that runs all night and works a lot (some external calls, Twitter, Google etc), and many DB calls active Using the record, over time this work increases memory size up to 4 gig. I do not know why the rack is not releasing the memory of the memory.

I started looking for a black box, but it Setup to look complicated Yes and has not been updated for more than a year. I am not able to take it for work locally so that I try to produce.

Thanks Joel

Before throwing two ideas, you are looping as part of this job, make sure that you refer to those items You are not catching up because you do not need them, because they should be collected from them. If you have done, remove them from your array, or whatever else, enter a periodic GC.start in your loop to see if this is not just around GC-ING .

The second idea is that Ruby does not have GC symbols, so if your API client can accumulate values ​​as a symbol of you, ends with a large and rising symbol, which ever Will not be used from Symbols are small, but small things can still be added

And, of course, do not load as much items as you need, use #find_each to load AR objects in batch if you Many of them have to iterate over.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -