[geotk] Out of memory error when decoding CRS

Riou Olivier Olivier.Riou at fr.thalesgroup.com
Tue May 24 08:55:45 EDT 2011


Hi everyone,

I've got the following error when decoding a CRS from my java application :

java.lang.OutOfMemoryError: PermGen space
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.defineClass(Unknown Source)
	at java.net.URLClassLoader.access$000(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClassInternal(Unknown Source)
	at
org.geotoolkit.referencing.factory.epsg.ThreadedEpsgFactory.createBackingSto
re(ThreadedEpsgFactory.java:636)
	at
org.geotoolkit.referencing.factory.ThreadedAuthorityFactory.getBackingStore(
ThreadedAuthorityFactory.java:348)
	at
org.geotoolkit.referencing.factory.CachingAuthorityFactory.availability(Cach
ingAuthorityFactory.java:266)
	at
org.geotoolkit.referencing.factory.CachingAuthorityFactory.getCitation(Cachi
ngAuthorityFactory.java:378)
	at
org.geotoolkit.referencing.factory.CachingAuthorityFactory.getVendor(Caching
AuthorityFactory.java:402)
	at
org.geotoolkit.factory.FactoryFinder$VendorFilter.filter(FactoryFinder.java:
798)
	at
org.geotoolkit.factory.FactoryRegistry.setOrUnsetOrdering(FactoryRegistry.ja
va:1146)
	at
org.geotoolkit.factory.FactoryRegistry.setOrUnsetOrdering(FactoryRegistry.ja
va:1130)
	at
org.geotoolkit.factory.FactoryRegistry.setOrdering(FactoryRegistry.java:1098
)
	at
org.geotoolkit.factory.FactoryFinder$1.pluginScanned(FactoryFinder.java:195)
	at
org.geotoolkit.factory.FactoryRegistry.scanForPlugins(FactoryRegistry.java:8
32)
	at
org.geotoolkit.factory.FactoryRegistry.scanForPluginsIfNeeded(FactoryRegistr
y.java:844)
	at
org.geotoolkit.factory.FactoryRegistry.getServiceProviders(FactoryRegistry.j
ava:236)
	at
org.geotoolkit.factory.FactoryFinder.getFactories(FactoryFinder.java:216)
	at
org.geotoolkit.factory.AuthorityFactoryFinder.getCRSAuthorityFactories(Autho
rityFactoryFinder.java:264)
	at
org.geotoolkit.referencing.DefaultAuthorityFactory.create(DefaultAuthorityFa
ctory.java:107)
	at org.geotoolkit.referencing.CRS.getAuthorityFactory(CRS.java:229)
	at org.geotoolkit.referencing.CRS.decode(CRS.java:426)

I'm not sure but I think I'm using an embedded database (with the attached
epsg.properties). I run my application with the JVM argument -Xmx1200m and I
cannot increase the memory anymore. I take a look at the memory usage during
the execution of the application and it seems that decoding CRS using
embedded database requires a lot of memory.

Is there any workaround to this problem ?
I prefer to use the epsg.properties file to define the CRS but, if not
possible, I have a mysql server running on the computer, perhaps it is
possible to use the mysql database to store the CRS and so to limit the
memory usage ? In this case, where can I find documentation ?


Olivier


More information about the Geotoolkit mailing list