Memory leak & symbols


I have an app with a memory leak which i can properly fix… using tools
like Eclipse Mat and VisualVM with the -J-Djruby.reify.classes=true
help because the leak suspects are always things like “RubyClass”,
“RubyMetaClass”, “RubyModule”…

How can i know if the leak that my app is experiencing is related to
symbols or something else?

Is there another param that can i add to my VM to get more information
can heap me to find the error?

JRUBY_OPTS="-J-Xss1m -J-Xms3072m -J-Xmx3072m -J-server --1.9
-J-XX:ReservedCodeCacheSize=128m -J-javaagent:/opt/newrelic/newrelic.jar
-J-Djruby.reify.classes=true -J-XX:+CMSClassUnloadingEnabled


just ignore MAT’s “leak suspects” - not completely but you need to do
own heap dump analysis … looking for GC roots with the candidates.
if it’s not showing up pointers to a RubySymbol instance than it’s
not caused by :symbol usage.

in terms of class unloading (due hot redeploys) - that’s a bit different
and depends on the server and libraries used … I would look at (JRuby
and/or web-app) class-loaders.

it’s generally not that hard to analyze dumps assuming you understand
Java class-loading “basics” but it’s hard (at least for me) to explain
knowing more app details.


On Mon, Feb 24, 2014 at 12:03 PM, Jos Antonio Silva P. <

Thanks for the answer Karol. I’ll take a look on the GC roots :slight_smile:

On Mon, Feb 24, 2014 at 8:48 AM, Karol B. [email protected] wrote:

it’s generally not that hard to analyze dumps assuming you understand some

To unsubscribe from this list, please visit:

José Antonio Silva P.
Code Artist & CTO

Av. Bicentenario 3883 Of. 303, Vitacura, Chile
phone: (56-2) 5871821 mobile: (56-9) 82179132
skype: silva.portell

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs