Search code examples
javaheap-memorydspace

Constant dspace error java.lang.OutOfMemoryError: Java heap space


I have a DSpace server, after uprading from version 4.3 to 5.1, it constantly stops working after some hours with following error:

java.lang.OutOfMemoryError: Java heap space

I've read answers to the same questions, but they didn't help me.

My JAVA_OPTS: -Xmx4096M -Xms4096M -Dfile.encoding=UTF-8 -Dsun.jnu.encoding=UTF-8

Here are my logs:

I searched the internet for a solution and could not find one, does any one have a clue?


Solution

  • Your tomcat log file quite clearly says that it isn't using the JAVA_OPTS you're passing in:

    INFO: Command line argument: -Xmx256m

    In my experience, DSpace 5 needs at least 512MB; your 4GB look a little excessive unless your DSpace instance is very big / gets lots of traffic.

    You aren't telling us what operating system you're using, so it's hard to give advice on how where to set these properly. Start with your tomcat startup script and/or the tomcat configuration files. On my Red Hat Enterprise Linux 6.6 boxes (with tomcat6), the correct place for the memory settings is /etc/tomcat6/tomcat6.conf.