Reputation: 2274
I had a misfortune of getting a task of searching for an unconfirmed memory leak. This is my first time using YourKit so while I know what I should be looking for, I have no idea where to look and how.
My understanding is that over time memory consumption goes up because certain objects are not being released. Pretty hard to do that in Rails, but I guess somebody figured out how.
Here's how memory telemetry looks like:
Ignoring the fact periods between GC increase over time, it looks like Old Gen memory is going up... maybe.
Now we probably need to know what objects are getting piled on there and what spawns them.
Steps I've taken so far:
After opening the memory snapshot in YourKit I have no idea what I should be looking for.
There's Call Tree in Allocations. Expanding the tree gives me a hint of some of the Rails code being run, but I have no idea if what I'm looking at is actually what I need.
Any Java profiling, Yourkit wielding, persons able to point me in a right direction?
Edit: Example of what I can see in Merged paths view:
Upvotes: 1
Views: 651
Reputation: 725
1) Do not use object allocation recording. It is almost useless for memory leak finding.
2) I recommend to periodically advance objects generation (it is very fast and does not add overhead). Take a look at http://www.yourkit.com/docs/java/help/generations.jsp
You will be able to split objects by "age" and understand why heap grows.
Since you are using Tomcat it might be helpful to take a look at "Web applications" http://www.yourkit.com/docs/java/help/web_applications.jsp If your application has problem with class reloading/redeploying it will be visible there.
Best regards, Vladimir Kondratyev YourKit, LLC
Upvotes: 3