users@glassfish.java.net

GF 2.1 PermGen Problem caused by not releasing remote references?

From: <glassfish_at_javadesktop.org>
Date: Thu, 30 Jul 2009 00:23:34 PDT

Hello Folks,

after a week of research, profiling and reading tons of articles am not any closer to fix my PermGen problem.

I have 2 EAR apps deployed to the same app server.
One has a session bean with a remote interfaces. The second has a servlet with init() that on start up get the remote reference via lookup().

By multiple re-deploys of the second app (I have scripts) it seems the web application classloader does not release the reference to the session bean in the first app!
If I comment off the look up I can deploy over night 60 times a minute, all good there.
So it must be something with the remote references not being released.

Now, I used few profiles and I was able to get the memory snap shots after 2, 3, 4 redeploys. It does look like there is each time a new instance of the web app classloader with the reference to the _remote. I also have an new instance of the EJB class loader too.

I tried assigning the reference in the servlet to null after looking it up (in init() or in destroy(), no effect. I tried to put a session bean under the servlet in the same application so that the session bean looks up the remote reference to the bean in another application, no effect.

I looked for possible memory leaks from 3rd parties in the web application (but I have none, I stripped everything out).

That should be not agains the J2EE spec to: deploy one app, start up a servelt, look up a remote reference to a bean in another app, redeploy.

I get a valid reference, I can call methods from the second app.
I don't have to explicitly release a remote reference to a remote session bean, do I?

That should be how 2 separate apps talk to each other e.g. looking up remote refs of its resources.

Any comment most welcome.

Joe
[Message sent by forum member 'unsu4711' (unsu4711)]

http://forums.java.net/jive/thread.jspa?messageID=358174