All Products
Search
Document Center

Application Real-Time Monitoring Service:Fix `OutOfMemoryError` after installing the ARMS agent

Last Updated:Mar 11, 2026

The ARMS agent uses approximately 100 GB of memory. Advanced features such as Continuous Profiling add further overhead. If your application throws an OutOfMemoryError after you connect it to Application Monitoring, increase the JVM memory allocation for the memory region reported in the error.

Identify the error type from your stack trace or application logs, then apply the corresponding fix.

ErrorCauseFix
OutOfMemoryError: Java heap spaceInsufficient heap memoryIncrease -Xms and -Xmx
OutOfMemoryError: PermGen spaceInsufficient permanent generation space (Java 7 and earlier)Increase -XX:PermSize and -XX:MaxPermSize
OutOfMemoryError: MetaspaceInsufficient metaspace (Java 8 and later)Increase -XX:MetaspaceSize and -XX:MaxMetaspaceSize

OutOfMemoryError: Java heap space

The JVM has run out of heap memory. Add the -Xms (initial) and -Xmx (maximum) parameters to your JVM startup options:

-Xms1024M
-Xmx2048M

This example sets the initial heap to 1 GB and the maximum heap to 2 GB. Adjust these values based on your application's memory requirements.

Note

In environments such as Tomcat, add these parameters to JAVA_OPTS in the configuration file.

You can also use -XX:InitialHeapSize and XX:MaxHeapSize to set the heap memory as a percentage. For details, see the JDK documentation.

OutOfMemoryError: PermGen space

The permanent generation space is exhausted. This error applies to Java 7 and earlier. Increase the PermGen allocation:

-XX:PermSize=256M
-XX:MaxPermSize=512M

OutOfMemoryError: Metaspace

The metaspace is exhausted. This error applies to Java 8 and later, where metaspace replaced PermGen. Increase the metaspace allocation:

-XX:MetaspaceSize=256M
-XX:MaxMetaspaceSize=512M