Jump to category:

What to do when you see "java.lang.OutOfMemoryError: Java heap space"

[ This article applies from Daisy version undetermined to version any ]


OutOfMemory errors can be caused by two things:

  • A programming error (e.g. an infinite loop that keeps eating memory or an object that does not properly release its resources).
  • There just is not enough available memory in the JVM (Java Virtual Machine).

If you are unsure which is the problem, you should assume it is the latter case and try the instructions below, if the problem persists,
contact us on the mailing list.

Increasing the maximum heap size

The problem can occur both on the repository side or on the wiki side, make sure you are configuring the appropriate component.

The maximum heap size is by adding a parameter to the java command that is used to start the repository or wiki:

java -Xmx256m (...)
  • If you are using the wrapper scripts, change the value for the parameter wrapper.java.maxmemory=...
  • If you are running the wiki on another servlet container (e.g. Tomcat), consult the documentation on how to increase the maximum heap size.