I'm running a geonetwork 3.0.1 instance on tomcat7. Regularly, i.e. every few actions of my only user, my tomcat runs into a PermGenSpace error. This especially occurs during harvesting of other catalogues.

I already configured geonetwork to use Postgres (postgres.xml). Then I adapted /ect/default/tomcat7 and set in the JAVA_OPTS: -Xms=1024m -XmX=2048m -XX:MaxPermSize=2048m. If I get it right, that should be the maximum tolerable values, as my server runs on 4GB RAM. Actually I am not sure, if those values are actually applied by the JVM, as I could not prove it with memory monitoring.

As the latest configuration improvement, I set the geonetwork_data_dir outside the tomcat webapp path. Since then, it seems to behave a bit improved, but I am still affected by this tiring PermGenSpace error.

Are there best practice experiences, which values to use, especially for -XX:MaxPermSize?

Are there suggestions, what else to enhance in the configuration?


I changed my server configuration and run with 6GB now. Other reconfiguration has been changing the JAVA_OPTS to

JAVA_OPTS="-Djava.awt.headless=true -Xms512m -Xmx1024m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+UseParNewGC -XX:NewRatio=2 -XX:+AggressiveOpts -Xrs -XX:PerfDataSamplingInterval=500 -XX:MaxPermSize=256m"

The out of memory errors disappeared until now, after a few tests. Also harvesting a remote CSW ran quickly and without disruption.

So in general I can run geonetwork with the 1GB heap and 256 Perm space as proposed in the accepted answer now.

1 Answer 1


Ciao, -XX:MaxPermSize=2048m is way too much IMHO.

I mean, if you have 4GB of RAM available you already have the OS, PostgreSQL then the Tomcat process for Tomcat with a max heap of 2GB. If account also for native memory use by the java process for Tomcat and then you put also 2GB for PermGen then you might soon be swapping!

I believe 1GB heap is more than enough for GN and 128M or 256M should be fine as well for PermGen.

Hope this helps, Simone.

  • Thanks for that opinion. I can't really imagine not to suffer from PermGen error with 256M if I have troubles with the current config. But I will test this. Do you think, allowing less memory may increase internal optimization for garbage collection and therefore probably result in better performance?
    – ulrich
    Commented Sep 2, 2015 at 18:49
  • You observations are sound indeed. We have some work upcoming with GN3, I will ping the devs as they start to do some testing and see if this is an issue in the code or a misconfiguration. I would suggest to ping again if you don't hear anything in 1w or so.
    – simogeo
    Commented Sep 3, 2015 at 13:03
  • That would be great!
    – ulrich
    Commented Sep 3, 2015 at 14:14
  • I tried to configure geonetwork with the values you provided. My complete line of JAVA_OPTS in /etc/default/tomcat7 is JAVA_OPTS="-Djava.awt.headless=true -Xms512m -Xmx1024m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+UseParallelOldGC -XX:+UseParallelGC -XX:NewRatio=2 -XX:+AggressiveOpts -Xrs -XX:PerfDataSamplingInterval=500 -XX:MaxPermSize=256m" But still suffering from PermGen or OutOfMemory error now (which occurs later now, btw). Could you find any hints according to this?
    – ulrich
    Commented Sep 13, 2015 at 20:20
  • 1
    Changed server RAM to 6GB, running with the following JAVA_OPTS: JAVA_OPTS="-Djava.awt.headless=true -Xms512m -Xmx1024m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+UseParNewGC -XX:NewRatio=2 -XX:+AggressiveOpts -Xrs -XX:PerfDataSamplingInterval=500 -XX:MaxPermSize=256m" works fine after a short test.
    – ulrich
    Commented Oct 14, 2015 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.