All Products
Search
Document Center

Simple Application Server:Release the reserved memory of a Linux server

Last Updated:Dec 04, 2025

Kdump is a kernel crash dump mechanism in Linux. It captures memory information when the system crashes, such as during a kernel panic, for later failure analysis. This mechanism requires reserved memory, called crashkernel, to save dump information. If your Linux server has limited memory, this document describes how to disable kdump and release the reserved memory to improve memory utilization.

Procedure

Important

Releasing the reserved system memory and disabling the kdump service prevents the system from collecting kernel crash information when a system failure occurs. This makes it difficult to promptly identify and fix kernel-related issues, which can affect server stability. Proceed with caution.

  1. View the reserved system memory.

    1. Connect to the Linux server.

    2. Run the following command to check whether crashkernel is enabled.

      cat /proc/cmdline

      If the output includes the crashkernel option, crashkernel is enabled.

      image

    3. Run the following command to view the size of the reserved memory.

      cat /sys/kernel/kexec_crash_size

      The output is similar to the following. In this example, the reserved memory size is 201326592 B (192 MiB).

      image

  2. Release the reserved system memory and disable the kdump service.

    1. Run the following command to back up the grub configuration file.

      sudo cp /etc/default/grub /etc/default/grub.bak
    2. Run the following command to delete the crashkernel configuration.

      1. For Alibaba Cloud Linux or CentOS:

        sudo grubby --update-kernel=ALL --remove-args="crashkernel"
      2. For Ubuntu or Debian:

        sudo sed -i 's/crashkernel=[^[:space:]]*[[:space:]]*//g' /etc/default/grub
    3. Run the following command to update the grub configuration.

      • Alibaba Cloud Linux or CentOS

        sudo grub2-mkconfig -o /boot/grub2/grub.cfg
      • Ubuntu or Debian

        sudo update-grub
    4. Run the following commands to stop the kdump service and disable it from starting on boot.

      • Alibaba Cloud Linux or CentOS

        sudo systemctl stop kdump
        sudo systemctl disable kdump
      • Ubuntu or Debian

        sudo systemctl stop kdump-tools
        sudo systemctl disable kdump-tools
    5. Run the following command to restart the system for the changes to take effect.

      sudo reboot
  3. Verify the result.

    1. Connect to the Linux server.

    2. Run the following command to check the kdump status. Confirm that the status is inactive (dead), which means the kdump service has stopped.

      • Alibaba Cloud Linux or CentOS

        sudo systemctl status kdump

        image

      • Ubuntu or Debian

        sudo systemctl status kdump-tools

        image

    3. Run the following command to view the grub configuration file.

      cat /proc/cmdline

      If the crashkernel configuration is not present in the output, it has been deleted.

      image

    4. Run the following command to view the size of the reserved memory.

      cat /sys/kernel/kexec_crash_size

      If the output is 0, the reserved system memory has been released.

      image