GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
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
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?
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.
@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.
Disable identity map by default
The identity map was causing more issues than expected: