PermGen issue when running Gears demo applet with plugin 2 ?

Hi there :slight_smile:

We are running a site which uses a JOGL applet, that is loaded and reloaded (but kept alive, the plugin/browser intercation is made this way) while the user crawls through the different pages.
At some time, it seems we exceed the perm gen limit of the JVM, and I guessed youā€™d perhaps have some answers or clues to fix this problem :wink:

There is a simple test case, using the gears applet. It requires a version of java with plugin 2 (means Java 6 with at least udpate 10).
Just copy copy in a html page :


<applet>
   <param name="jnlp_href" value="http://download.java.net/media/jogl/demos/www/applet-gears.jnlp">
</applet>

Hit reload, while monitoring non-heap memory with jconsole (Iā€™m using JRE 1.6.0_19-b04, on a debian lenny machine (GL_VENDOR: NVIDIA Corporation, GL_RENDERER: G96-875-GL/PCI/SSE2, GL_VERSION: 2.1.2 NVIDIA 173.14.09). You should see a mere 2M jump for each reload.

I checked with the previous applet-launcher.jar technic, I donā€™t have behaviour. Doing some memory engineering with yourkit point me to a problem of jnlp2classloader: a new one seems to be spawned each time the page is reloaded, while the ancients are not evicted.

Has anyone heard of this problem ? If not, would you have any advice to solve this problem ?

Cheers

-manu

you could use a jvm argument to increase the maxpermsize but thatā€™s not really a nice solution.

maybe better to try to always launch another jvm :

EDIT : maxpermsize happend when to much class definition is loaded

Hi, thanks fot this answer :slight_smile:

Indeed, adding the separate_jvm fixes the problem, but the withdraw is that the jvm starts/stops every time you reload/change the page, and hence slows the navigationā€¦
Itā€™s perhaps a ā€œplugin 2ā€ & jnlp only problem, Iā€™ll check if ever, with a vanilla applet (without Jogl), the problem still happens.

cheers :slight_smile:

-manu