[geotk] Out of memory error when decoding CRS

Riou Olivier Olivier.Riou at fr.thalesgroup.com
Wed May 25 09:13:33 EDT 2011


I do not know a lot about the design of geotoolkit, embedded databases and
wep apps. Do you mean that geotoolkit is base or some of its modules (like
the derby database which  stores the EPSG referencing data) are using web
app technologies ?
In this case, it could explain the problem because I'm also currently
investigating on JVM crash on my application which may causes geotoolkit to
not initialize properly when restarting the application after the crash ?
My application is not a web app but it uses an embedded OpenEJB server and
Hibernate to access to a mysql database so, even if geotoolkit does not use
web technologies, I think that geotoolkit classes are deployed through the
EJB server. As I said, I do not know very well EJB, perhaps some one can
confirm this.
However, since its a JVM crash, there is no way to call Setup.shutdown()
method before the JVM exits and, if it is effectively the cause of the
problem, I have to find another workaround. Is this can be fixed if I do not
use geotoolkit with an embedded database anymore (only with the
epsg.properties) ?
 
Thanks
 
Olivier
 
-----Message d'origine-----
De : Martin Desruisseaux [mailto:martin.desruisseaux at geomatys.fr]
Envoyé : mercredi 25 mai 2011 13:20
À : geotoolkit at lists.osgeo.org
Cc : Jon Blower; Riou Olivier
Objet : Re: [geotk] Out of memory error when decoding CRS



Le 25/05/11 12:52, Jon Blower a écrit : 

Sorry to join this late - I notice that this is a PermGen memory error,
which is connected with classloading, not heap memory usage.  This commonly
happens when redeploying a web application without a clean restart of the
app server.  I don't fully understand this type of error, but you might like
to try cleanly restarting your app server (if you're using one) or
increasing the permgen space using a command-line switch to the JVM (sorry,
can't remember what the syntax is!)


Thanks for the feedback. Actually there is known issues in Geotk regarding
undeployment: some threads are not killed and some java.lang.ThreadLocal
variables are not cleared, which prevent the JVM to unload every Geotk
classes before to reload them when redeploying.

An attempt to mitigate the problem has been provided with the
<http://www.geotoolkit.org/apidocs/org/geotoolkit/lang/Setup.html#shutdown%2
8%29> Setup.shutdown() static method, which can be invoked when you know
that your application is about to be undeployed (if possible). However this
does not solve all issues. We are investigating usage of JSR-330 and OSGi
(now that Oracle confirmed that JDK-8 will be compatible with OSGi) as a
better fix (but we will not force user to use OSGi).

In the maintime the workaround proposed by Jon still the most reliable
approach.

    Martin



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geotoolkit/attachments/20110525/d89d4ba1/attachment.html


More information about the Geotoolkit mailing list