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.
| Error | Cause | Fix |
|---|---|---|
OutOfMemoryError: Java heap space | Insufficient heap memory | Increase -Xms and -Xmx |
OutOfMemoryError: PermGen space | Insufficient permanent generation space (Java 7 and earlier) | Increase -XX:PermSize and -XX:MaxPermSize |
OutOfMemoryError: Metaspace | Insufficient 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
-Xmx2048MThis 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.
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=512MOutOfMemoryError: 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