Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Closed

Memory leaks in 3.4.1? #302

benjaminjackson opened this issue Aug 7, 2012 · 2 comments

Comments

@benjaminjackson
Copy link

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?

@stve
Copy link
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.

@sferik
Copy link
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 as completed Aug 13, 2012
sferik added a commit that referenced this issue Sep 18, 2012
The identity map was causing more issues than expected:
* #260
* #285
* #302
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants