From the GlassFish end of things, we've noticed three things that cause
this.
The first is Grizzly caching Request objects in thread local. While
that's good for performance reasons, it ends up meaning that a reference
to the JRuby runtime will stick around until the cache is cleared. There
should be a fix in the next released version of GlassFish (both gem and
server), and in the mean time you can "manually" clear the cache by
sending several requests to the server after undeploy, such as to a
non-existent contextroot.
We've also seen some issues around JRuby unregistering itself as a
secure communications provider (through JRuby-openssl). Similarly, that
ends up keeping a reference to a JRuby runtime, so that things aren't
collected. I know that the JRuby people are working on getting a fix
together for that, in the mean time the default JRuby limited openssl
doesn't seem to have this issue.
Lastly, there is
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4957990 , which
likely affects all of the listed application servers. As mentioned in
the bug, increasing permgen size (while having class unloading enabled)
will cause correct behavior and no leak. I'm working with one of the JDK
team members to get a fix for this finally integrated into the JDK.
Tomcat and JBoss may have other, or additional, causes of permgen
leakage. I haven't looked into this using them, so I can't provide much
information there.
Chad Johnson wrote:
> Mik,
> I've noticed that when I redeploy my JRoR application (no matter the
> app server Tomcat, Glassfish, JBoss) I am leaking about 20 megs of
> permgen. See this bug for more details :
>
>
http://jira.codehaus.org/browse/JRUBY-3281>
> It's marked as "Not A Bug" but it certainly is still occurring.
> Also, when monitoring my App server over JMX I can clearly see JRuby
> runtime's piling up on a redeploy as well. I assume the two are
> connected.
>
> -Chad Johnson
>
> On Sun, Jun 21, 2009 at 6:26 PM, Michael Gannon<
michael.gannon@...> wrote:
>
>> Thanks, that is some useful information. We know that we do have a leak in
>> the main code, we are using JFreeChart and it 'seems' to be coming from
>> there, as such we may have to live with this for the time-being. We will
>> increase the PermGen size and see where we get.
>>
>> Cheers,
>> Mik.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>
http://xircles.codehaus.org/manage_email>
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email