All Products
Search
Document Center

:Troubleshoot Out of Memory issues in a Linux instance

Last Updated:Feb 14, 2026

This topic describes how to identify, analyze, and resolve Out of memory (OOM) issues on Linux instances.

Background information

The OOM killer is a Linux kernel mechanism that terminates processes to free up memory and maintain system stability when memory resources are critically low. When memory resources are insufficient, you might see many 'Out of Memory' messages in the system logs. This indicates the system cannot allocate enough memory for applications, which can disrupt their operation and data I/O.

Causes

Frequent OOM errors on your Linux instance are often caused by one of the following:

  • The instance has insufficient memory for your workload, often because the selected instance type is too small for the memory requirements of your applications.

  • Your application uses memory inefficiently, leading to memory leaks or excessive consumption that triggers OOM events.

Troubleshooting steps

To troubleshoot OOM issues, follow these steps:

  1. View OOM-related logs.

    Run the following commands to view the Linux system logs.

    sudo less /var/log/messages
    sudo less /var/log/syslog

    Search the logs for keywords such as oom or kill to find relevant log entries. If you suspect an application is causing the OOM event, check its specific logs to identify the root cause.

  2. Check the current memory usage of the system.

    1. Use the top or free command to check the instance's memory usage. For detailed instructions, see What do I do if the memory usage of a Linux instance is high?

    2. Alternatively, use CloudMonitor to view the instance's memory metrics. For more information, see Operating system monitoring.

Recommended solutions

Choose a solution based on your findings.

Cause

Recommendation

Insufficient instance memory for the workload.

Upgrade the instance type to one with more memory.

Warning

When you change the instance type of a subscription instance, you must restart the instance. To minimize impacts on your business, we recommend that you perform the operation during off-peak hours.

Inefficient memory usage by the application.

Optimize the application code, such as implementing paging for batch query requests.

References