All Products
Search
Document Center

Application Real-Time Monitoring Service:Diagnose high heap memory usage with memory hotspot

Last Updated:Sep 04, 2026

The memory hotspot feature in Application Real-Time Monitoring Service (ARMS) helps identify the root causes of high Java Virtual Machine (JVM) heap memory usage. It uses continuous profiling to record the size and frequency of memory allocations whenever a thread exceeds the heap allocation threshold. It also captures a method stack snapshot at that time. When your system experiences high JVM heap memory utilization, memory hotspot quickly pinpoints the specific business logic methods that cause large or frequent heap memory requests.

Enable memory hotspot

  1. Log on to the ARMS console. In the left-side navigation pane, choose Application Monitoring > Application List.

  2. On the Application List page, select a region at the top, and then click the name of your application.

    Note

    The icons in the Language column indicate the following:

    Java图标: A Java application connected to Application Monitoring.

    image: A Go application connected to Application Monitoring.

    image: A Python application connected to Application Monitoring.

    -: An application connected to Managed Service for OpenTelemetry.

  3. In the left-side navigation pane, click Application Settings, and then click the Custom Configuration tab.

  4. In the Continuous profiling section, turn on the Main switch, and then turn on the Memory hotspot switch. Specify the IP addresses of the application instances to enable, or a CIDR block for a group of instances.

  5. At the bottom of the page, click Save.

    The changes take effect immediately. No application restart is required.

View memory hotspot data

Example: A method that allocates 1 MB of heap memory per second.

public class FixedRateAllocAction {

    // The entry point for the request.
   public void runBusiness() {
        try {
            sink = new byte[1024];
        } catch (InterruptedException e) {
            // Ignore
        }
    }
}
  1. Log on to the ARMS console. In the left-side navigation pane, choose Application Monitoring > Application List.

  2. On the Application List page, select a region at the top, and then click the name of your application.

    Note

    The icons in the Language column indicate the following:

    Java图标: A Java application connected to Application Monitoring.

    image: A Go application connected to Application Monitoring.

    image: A Python application connected to Application Monitoring.

    -: An application connected to Managed Service for OpenTelemetry.

  3. In the left-side navigation pane, click Continuous profiling. From the instance list on the left, select your target instance. Then, on the right, set the time range for the data.

  4. On the Single View tab, you can filter data and view aggregated analysis.

  5. Click Aggregation & Analysis. On the page that appears, set Profiling Type to Allocated Memory.

    Note

    Profiling types:

    • CPU Time: CPU hotspot profiling data. For more information, see Diagnose high CPU utilization with CPU hotspot.

    • Allocated Memory: Memory hotspot profiling data for allocation volume.

    • Allocations: Memory hotspot profiling data for allocation frequency. This helps identify which methods frequently request memory.

    On the Aggregation & Analysis page, the list on the left shows the heap memory allocation volume of all methods involved in this call. The flame graph on the right is generated from the stack traces of those methods. The columns are defined as follows:

    • The Self column shows the resources a method consumes, excluding its child methods. This helps identify methods that consume significant resources.

    • The Total column shows the resources a method and its child methods consume. This helps identify the largest contributors to the call stack's resource consumption.

    Perform the following analysis:

    1. Sort the Self column in descending order. Find and click the method with the largest Self value, com.alibaba.cloud.pressure.memory.FixedRateAllocAction.runBusiness(). The flame graph on the right will focus on the relevant methods.

    2. In the focused flame graph on the right, com.alibaba.cloud.pressure.memory.FixedRateAllocAction.runBusiness() is the widest frame at the top.

    3. A wide frame at the top of a flame graph represents an application-defined method. This indicates that the com.alibaba.cloud.pressure.memory.FixedRateAllocAction.runBusiness() method is a significant performance bottleneck that consumed substantial resources during profiling. Use the method name to examine its business logic for optimization opportunities.

Based on this analysis, the com.alibaba.cloud.pressure.memory.FixedRateAllocAction.runBusiness() method allocated 56.56 MB of heap memory within one minute, which aligns with the example.

References

You can use the continuous profiling feature to investigate slow traces and high CPU utilization. For more information, see the following topics:

For common issues with continuous profiling, see FAQ.