You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
High instance load issue
Troubleshooting and solution for high memory usage of ECS instance with Linux system
Copy page
Download PDF
Troubleshooting and solution for high memory usage of ECS instance with Linux system
This topic describes how to use the free command and the Atop tool to troubleshoot the issue of high memory usage (usage exceeding 80%) on a Linux instance.​
Procedure​
  1. Log in to the target instance. For operation details, refer to Logging in to Linux instances.​
  1. Execute the following command to query the real-time memory usage.​
  • ​
    free -g​
    ​
  • Sample output​
  • ​​​
tip​
  • Memory usage = (total-free) /total. When memory usage exceeds or is equal to 80%, the usage is considered too high.​
  • total: Indicates memory size available to the system, that is, physical memory minus reserved memory and memory used by the kernel. The value at the intersection of this column and the Mem row is the total memory size.​
  • free: Indicates memory that is completely unused by the current system. The value at the intersection of this column and the Mem row is the available memory size.​
  1. Use the Atop tool to view the memory usage ranking.​
  1. Make sure that the Atop tool is installed on the target instance. If the Atop tool is not installed, execute the following commands to complete the installation.​
  • CentOS​
  • ​
    sudo yum -y install atop​
    ​
  • Ubuntu, Debian​
  • ​
    sudo apt update ​
    sudo apt -y install atop​
    ​
  1. Execute the following command to view the real-time memory usage ranking.​
  • ​
    atop -m​
    ​
  • Sample output​
  • ​​​
  1. Based on VSIZE (virtual memory), RSIZE (actual memory), and CMD (process name), confirm whether the process with high memory usage meets expectations, and obtain the PID (process identifier) of the target process.​
  • If the process meets expectations​
  • Optimize the program processing logic for this process to reduce memory usage. You can also upgrade your instance configuration to prevent program operations from being affected due to low instance specifications. For details, see Changing instance types.​
  • If the process fails to meet expectations​
  • You can execute the following commands to manually terminate the abnormal process.​
warning​
  • Terminating the process may cause data loss of the target process.​
  • Terminating key operating system processes may cause the system to restart. Please proceed with caution.​
  1. On the Atop monitoring page, press k key to enter process termination mode.​
  • ​​​
  1. Enter the target process PID and press Enter to confirm.​
  • ​​​
  1. Enter 9 and press the Enter key to confirm and forcibly close the process.​
  • ​​​
Last updated: 2026.06.18 17:49:51