OutOfMemoryError

While processing very large files (or large volumes of data from the database), you receive an OutOfMemoryError 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 unpleasant is that the profile that terminated with this error is not necessarily responsible for most of the memory and therefore the error. In fact, it could have been any part of the Java program (Integration Server, services, ...) that needed a few more bytes. So the culprit is not immediately clear.

Secondly, the consequences of this error are completely undefined. In some cases, vital parts of the Integration Server may be affected. It is also possible that the effects may not become apparent until long after the OutOfMemoryError 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 OutOfMemoryError from the outset.