OutOfMemoryError

While processing very large files (or large volumes of data from the database), you receive an 'out of memory' error message. Quite at the beginning of the message, you will see the following line.


java.lang.OutOfMemoryError: Java heap space


This is one of the nastiest errors that can occur.

Here’s what has happened: the Java process has tried to allocate some memory, but the system will not allow this as the process has already reached the maximum memory limit that was given on startup. The culprit is likely to be a profile that is taking up an unnecessary amount of memory.

What makes this error so horrible is that what is terminated with this error is not necessarily the profile which used the last of the memory; in fact, any part of the Java program that needs a few more bytes could fail. So the culprit is not immediately clear.

Secondly, the consequences of this error are completely undefined. In some cases, vital parts of Lobster_data or the integration server may be affected. It is also possible that the effects may not become apparent until long after the “out of memory” error occurs. Because of this, a system that has run out of memory should be restarted as soon as possible (the Java process, not the entire computer!).

Afterwards, it can often be very difficult to determine what part of a profile overloaded the memory. The typical causes are therefore listed below, along with details of how to avoid the error from the outset.