quality@glassfish.java.net

Re: Is anyone else hitting 'OutOfMemoryError: PermGen space' on a regular basis with GlassFish 3.0 ?

From: Richard Kolb <rjdkolb_at_gmail.com>
Date: Wed, 11 May 2011 14:19:25 +0200

On 11 May 2011 14:06, Paul Merlin <eskatos_at_n0pe.org> wrote:

> Quoting Richard Kolb <rjdkolb_at_gmail.com>:
> > > Indeed, I agree that having it documented clearly in all JEE books and
> > > related products manuals would be nice.
> >
> > How about NetBeans and Eclipse warning you before it happens and asking
> for
> > a restart ?
>
> Seems hard to achieve as it depends heavily on references graph at runtime.
>

Maybe I see it more simply. I attach a JConsole to my Glassfish when I
develop, and I can see my Perm Gen creeping up and up until poof. So just
attach a debugger before the deploy , see it is greater than 90 % and
suggest a restart ?


>
>
> > > BTW I believe that OSGi can suffer from the very same issue.
> >
> > Ouch. Did not know that.
>
> From my point of view, the garbage collection paradigm mandates that
> developpers
> take care of their references. I've seen little cases of that issue created
> directly and only by a developer code but often by used libraries and their
> usage where objects keep "static back references" to objects of classes
> from the
> application server classloader. So it can virtually happen in any managed
> code
> context if you don't take care of it. Using external libraries makes things
> harder.
>
> Yet again that's what I understood while experimenting and reading,
> sometimes
> the solution hides in details. If someone with big knowledge in this area
> could
> write an article/howto/faq/post about this subject I'm sure he'll get big
> momentum from the Java community.
>

*cough* the one with the big knowledge on this is not me. I just see the
result. The links you sent are quite complex to understand,
*another cough* you volunteering ?


regards
Richard.