quality@glassfish.java.net

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

From: Paul Merlin <eskatos_at_n0pe.org>
Date: Wed, 11 May 2011 14:32:47 +0200

Quoting Richard Kolb <rjdkolb_at_gmail.com>:
> 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 ?

I see, something more like a health monitor :)
That surely would help people restarting their container before crashing but I
don't see the real added value over a OOME here : you have to restart anyway.


> > 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 ?

:-D

I thought about doing it while writing my email but .. I'm afraid I don't
understand totally the issue, it feels just wrong to me. It would be a
challenging task to write a comprehensive article. Plus I don't have a lot of
free time theses months. Maybe if I face it again in the future I'll get enough
motivation but hey, if this really piss me off, writing another rant post won't
be really usefull.

To be continued :)


/Paul