Memory Leak Experienced With JRuby/Tomcat

I’ve been experiencing obvious memory leaks running JRuby with Tomcat
using warbler, and have narrowed it down to make it happen for on a
clean Rails app rendering a blank HTML page (basically just processing
any HTTP request that goes through the Rails dispatcher, doesn’t happen
with static files)

My environment is Tomat 6, JRuby 1.6RC1 (also tried 1.5.3), Rails 2.3.9,
jdbcmysql-adapter with the war being compiled using Warbler. Tried this
using both OS X and Windows.

When I make HTTP requests, I can easily see the memory growing per
request. This continues until the app server breaks (tried heap space of
1GB, 2GB, etc) due to out of memory.

Using a profiler, besides many Object and char arrays, I see instances
of org.jruby.runtime.callsite.NormalCachingCallSite increasing.

Because I’m testing this against a completely blank Rails app, I’m
starting to think it’s environment related. Tried to go back to Tomcat
5.5 but that requires jruby-rack 0.9.6 which is no longer available.

Has anyone experienced anything close to this using Tomcat6 + JRuby?

On Thu, Jan 13, 2011 at 11:51 PM, Hamed H. [email protected] wrote:

When I make HTTP requests, I can easily see the memory growing per
request. This continues until the app server breaks (tried heap space of
1GB, 2GB, etc) due to out of memory.

How much does the memory grow for each request? Or, how many requests
to grow to 1GB of memory?

Using a profiler, besides many Object and char arrays, I see instances
of org.jruby.runtime.callsite.NormalCachingCallSite increasing.

Could you file a bug at http://bugs.jruby.org? If you could include
profiling artifacts, environment stuff (versions of everything), and
maybe even upload the war file you used somewhere, that would help.

Because I’m testing this against a completely blank Rails app, I’m
starting to think it’s environment related. Tried to go back to Tomcat
5.5 but that requires jruby-rack 0.9.6 which is no longer available.

You can try installing jruby-rack 1.0.0.1 which should be compatible
with Tomcat 5.5.

/Nick

Thanks Nick. I’ve filed a bug report
http://jira.codehaus.org/browse/JRUBY-5378 and included the war file
with it.

Tomcat 5.5 didn’t make a difference and the memory is about ~60KB per
request, which seems like a lot, in that it should be something obvious.