Memory snapshot
Memory snapshots capture detailed memory consumption data, helping you troubleshoot issues such as memory leaks and memory waste that JVM monitoring charts alone cannot diagnose.
Prerequisites
-
Your application is integrated with Cloud Monitor 2.0.
-
Memory snapshots are available only for Linux systems.
Limitations
-
Memory snapshots are stored for 90 days.
Create a memory snapshot
-
On the Applications page, click the name of your target application. Then, in the top navigation bar, choose .
-
Click . In the Create Memory Snapshot dialog box, select an IP address and click .
NoteIf you have already selected an instance on the left side of the page, its IP address is automatically selected in the IP field.
-
In the confirmation dialog box, click force dump.
ImportantA memory snapshot task can take from a few minutes to half an hour. The application is unresponsive while the dump is in progress. Use this feature with caution.
View memory snapshot details
In the snapshot list, the Status column indicates the result: green for success, blue for in progress, and red for failure. Click the
icon on the left to view task progress.
Click on the right of the target task to view analysis results in the Application Troubleshooting Platform (ATP). For more information, see the ATP documentation.
FAQ
Why not create automatic snapshots before an OOM?
When an application approaches an out-of-memory (OOM) error, system resources are already under heavy load. Because creating a memory snapshot is resource-intensive, doing so automatically at this point risks triggering the OOM error. For this reason, Application Real-Time Monitoring Service (ARMS) does not support automatic pre-OOM snapshots. Instead, use the following steps to capture and analyze a memory snapshot:
-
Configure your application with the following parameters. When an OutOfMemoryError occurs, the JVM automatically generates a memory snapshot and saves it to
/tmp/heap.bin.In a Kubernetes environment, you must mount the
/tmp/heap.binpath to an external storage volume to ensure the file persists after a pod restart.-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/heap.bin -
Upload the memory snapshot that was automatically created during the OOM event to Object Storage Service (OSS). For more information, see Quick start.
-
Use ATP to perform Java heap analysis on the memory snapshot. For more information, see Quick start for Java heap analysis.