Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Memory leaks in 3.4.1? #302

Closed
benjaminjackson opened this Issue Aug 7, 2012 · 2 comments

Comments

Projects
None yet
3 participants

I'm using the gem to run a ton of queries and see my memory grow to gigabytes, which I've tracked down in Instruments to the YAJL JSON parse calls in the Twitter gem. Any idea what's going on, or how I might fix this?

Collaborator

stve commented Aug 7, 2012

Can you be more specific about the leak you are seeing?

Depending upon how you are using the gem, you may want to consider disabling the identity map, as that has led to similar issues elsewhere: tweetstream/tweetstream#87

If an identity map is useful to you, you might also consider implementing an adapter like the one in this example so that you can leverage an identity map while mitigating memory consumption.

Owner

sferik commented Aug 8, 2012

@benjaminjackson Did disabling the identity map fix the memory leak for you or is it still an issue?

The purpose of the identity map (or, for that matter, any cache) is to trade memory in exchange for fewer CPU cycles. Obviously, this tradeoff is not optimal for every use case, which is why we give you the ability to disable it. Arguably, it should be disabled by default, but I think the default is correct for most uses.

@sferik sferik closed this Aug 13, 2012

@sferik sferik added a commit that referenced this issue Sep 18, 2012

@sferik sferik Disable identity map by default
The identity map was causing more issues than expected:
* #260
* #285
* #302
c6c5960
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment