« Return to Thread: PermGen OutOfMemory, JRuby 1.2.0
On Fri, Jun 19, 2009 at 2:12 AM, Michael Gannon <michael.gannon@...> wrote:Hi List,
We have been pushing our application with some performance testing of late and during these tests we are experiencing some PermGen out-of-memory problems using JRuby 1.2.0 + Rails 2.2.2. Our application is a multithreaded app, a main thread with a number of worker threads. The worker threads are fairly simple really, mainly making use of ActiveRecord libraries, then we simply let them die.
For our testing we have increased the heap size and only now are we encountering a PermGen problem. I have read the article by Nick Sieger (http://blog.nicksieger.com/articles/2008/02/21/jruby-and-the-permanent-generation) but what isn't clear is how to estimate the required PermGen size, when is enough enough? Is there a reason why we are only encountering the problem after increasing the heap size?
We as yet have not changed the default PermGen sizes so they are as default (64m max?) as we want to understand what is going on before we start increasing things across the board.
Hi Mik,
As Pawel says, GC can be a mysterious beast. It wouldn't surprise me that by increasing heap size, you also increase PermGen requirements. JRuby uses soft references in a few places to control how much to cache, so when you increase heap you also increase how much is cached since the soft references don't get collected as quickly. I can't guarantee that your PermGen issues are the direct consequence of this, but it's possible.
I guess my question boils down to a few things:
1/ Do we have a problem? A leak? What is a good stratery for detecting this leak? Or is it a known problem solved with a larger PermGen space?
If you have a leak, increasing PermGen would only delay the OOM condition -- so you can try increasng to 128M and see what happens.
2/ If more PermGen space is the answer how can we estimate the requirements?
It's pretty much a wet-finger-in-the-wind game. We use 256m of PermGen ceiling for kenai.com, and I wouldn't expect too many Rails apps to get any bigger than that. If they do, I'd suspect JRuby to be at fault.
/Nick
« Return to Thread: PermGen OutOfMemory, JRuby 1.2.0
| Free embeddable forum powered by Nabble | Forum Help |