,

Updated at:

The out-of-memory (OOM) diagnosis feature analyzes and identifies why an operating system runs out of memory. Run an OOM diagnosis to determine the cause of an OOM event on an ECS instance and review the findings in a diagnostic report.

Scenarios

The following table describes the OOM scenarios that the OOM diagnosis feature analyzes.

Scenario

Description

System-wide out of memory

Overall memory usage on the host is too high. The system runs out of memory and triggers an OOM event.

cgroup memory limit exceeded

Processes in a specific cgroup use more memory than the configured limit. The total memory usage of the cgroup reaches its limit and triggers an OOM event.

Parent cgroup memory limit exceeded

Processes in a parent cgroup use more memory than the configured limit. The total memory usage of the parent cgroup reaches its limit and triggers an OOM event. To terminate a process, the system selects a process in a child cgroup.

cgroup memory limit exceeded due to excessive shared memory usage

When a cgroup exceeds its memory limit, the shared memory in the cgroup is found to account for more than 30% of the total user-mode memory of the cgroup. In this case, excessive shared memory usage is the primary cause of the OOM event, and you must further analyze which files consume the shared memory.

Out of memory on a memory node

In the NUMA memory model, an operating system can have multiple memory nodes. The cat /proc/buddyinfo command shows the memory distribution across these memory nodes. If the cpuset.mems parameter restricts a cgroup to the memory of specific memory nodes, the OOM killer can be triggered even when the instance still has enough free memory.

Limits

The following limits apply to the OOM diagnosis feature:

  • Region availability

    China (Hong Kong) and regions within the Chinese mainland

  • Operating system limits

    Architecture

    Operating system

    x86 architecture

    • Rocky Linux 9.5

    • Rocky Linux 9.1

    • Ubuntu 20.04

    • Alibaba Cloud Linux 3 container-enhanced edition

    • Rocky Linux 8.8

    • Ubuntu 22.04

    • Alibaba Cloud Linux 3 Pro

    • Alibaba Cloud Linux 2/3

    • CentOS 7.6 and later, or CentOS 8

    • Anolis OS 7/8

    • Ubuntu 24.04

    ARM architecture

    • Alibaba Cloud Linux 3 Pro

    • Alibaba Cloud Linux 3

Prerequisites

  • Permissions — If you use a Resource Access Management (RAM) user, make sure that your Alibaba Cloud account has granted the AliyunECSReadOnlyAccess and AliyunSysomFullAccess system policies to the RAM user.

Procedure

  1. Log on to the Cloud Monitor 2.0 console, select the target workspace, and then click All Features in the left-side navigation pane.

  2. On the All Features page, click CloudLens for ECS.

  3. At the top of the page, click System Diagnosis (SysOM).

  4. Set Diagnosis Mode to Node Diagnosis.

  5. From the Type of diagnosis list, select Memory Diagnostics.

  6. From the Diagnostic Item list, select OOM diagnosis.

  7. Select the target Instance ID.

  8. Click Run Diagnosis.

  9. In the Diagnosis Records section, click View Report.

Diagnostic report

The diagnostic report contains the following items. An item whose name starts with a condition in parentheses appears only when the diagnosis identifies that condition:

  • Basic Information

    The Basic Information section summarizes the diagnosis with key details, including the instance ID (which serves as the resource ID), diagnosis item, diagnostic report ID, and diagnosis start time.

  • Diagnosis conclusion

    This section provides the conclusion of the diagnosis and describes the primary cause of the OOM event in detail.

  • Recommendations

    This section provides recommendations based on the diagnosis results to help you reduce or prevent OOM events of the same type.

  • Diagnosis details

    • OOM diagnosis details

      This section shows the task that triggered the OOM event, the cgroup that the task belongs to, the cgroup that triggered the OOM event, and the OOM type.

    • (Host OOM) Memory usage analysis

      If insufficient host memory triggered the OOM event, this section shows the memory usage of the host when the event occurred. The section includes the proportions of system, application, and free memory, the distribution of system memory usage, and the distribution of application memory usage.

    • (cgroup OOM) Shared memory file usage

      If excessive shared memory usage in a cgroup triggered the OOM event, this section provides a table that ranks shared memory files by usage.

    • Task list at the time of the OOM

      This section lists the system tasks at the time of the OOM event, including the task name, process ID, and user-mode memory usage (RSS).

    • (Unreclaimable slab) Unreclaimable slab list

      If excessive unreclaimable slab memory usage triggered the OOM event and the kernel version of the operating system is 5.10 or later, such as Alibaba Cloud Linux 3, this section lists unreclaimable slab usage.