JAVA heap space error when using Geonetwork metadata full view

558 Views Asked by At

I'm using Geonetwork 3.10 with APACHE Tomcat on a CENTOS 7 machine. These are the charatertics of the various components:

  • Server version: Apache Tomcat/7.0.76
  • Java Home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.222.b10-0.el7_6.x86_64/jre
  • JVM Version: 1.8.0_222-b10
  • OS Name: Linux
  • OS Version: 3.10.0-957.27.2.el7.x86_64

My catalog should manage a starting number of metadata of about 35000 files and this number will increase. Unfortunately, I'm facing the following error when I'm trying to see the full metadata view:

An error occurred while loading a metadata view

looking at the log using the journalctl -f command it corresponds to the following error:

DEBUG [org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver] - Resolving exception from handler [public void org.fao.geonet.api.records.formatters.FormatterApi.getRecordFormattedBy(java.lang.String,java.lang.String,java.lang.String,org.fao.geonet.api.records.formatters.FormatterWidth,java.lang.String,java.lang.String,org.fao.geonet.api.records.formatters.FormatType,boolean,org.springframework.web.context.request.NativeWebRequest,javax.servlet.http.HttpServletRequest) throws java.lang.Exception]: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.OutOfMemoryError: Java heap space

Another error still related to Java heap space is the following:

SEVERE: Unexpected death of background thread containerBackgroundProcessor[StandardEngine[Catalina]] java.lang.OutOfMemoryError: Java heap space

that appears looking at

/var/log/tomcat/catalina.2020-01-24.log.

I'm using a Postgres database and I have set it in the

geonetwork/WEB-INF/config-node/srv.xml

file uncommenting the line

<import resource="../config-db/postgres-postgis.xml"/>

I have set the file /usr/share/tomcat/bin/setenv.sh and /etc/tomcat/tomcat.conf, respectively, with the following values

export CATALINA_OPTS="-Dfile.encoding=UTF-8 -Xms3072m -Xmx3072m -XX:PermSize=530m -XX:MaxPermSize=3072m"
JAVA_OPTS="-Xms4096m -Xmx4g -Xss2M -XX:+UseG1GC"

The java heap space error also appears during the harvesting

An error occurred while harvesting a local file:Java heap space.

Another error I use to find in the log is the following

*DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - Could not set JDBC Connection read-only
org.postgresql.util.PSQLException: Cannot change transaction read-only property in the middle of a transaction.

I correctly set the credentials in the file geonetwork/WEB-INF/config-db/jdbc.properties

But it always results in a READ-ONLY connection even if I check the .jdbc.properties I have

jdbc.basic.defaultReadOnly=false

Could please tell me what I'm doing wrong? Are there any other fine-tunings that I'm not doing?

0

There are 0 best solutions below