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
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.
View the reserved system memory.
Run the following command to check whether crashkernel is enabled.
cat /proc/cmdlineIf the output includes the
crashkerneloption, crashkernel is enabled.
Run the following command to view the size of the reserved memory.
cat /sys/kernel/kexec_crash_sizeThe output is similar to the following. In this example, the reserved memory size is 201326592 B (192 MiB).

Release the reserved system memory and disable the kdump service.
Run the following command to back up the grub configuration file.
sudo cp /etc/default/grub /etc/default/grub.bakRun the following command to delete the
crashkernelconfiguration.For Alibaba Cloud Linux or CentOS:
sudo grubby --update-kernel=ALL --remove-args="crashkernel"For Ubuntu or Debian:
sudo sed -i 's/crashkernel=[^[:space:]]*[[:space:]]*//g' /etc/default/grub
Run the following command to update the grub configuration.
Alibaba Cloud Linux or CentOS
sudo grub2-mkconfig -o /boot/grub2/grub.cfgUbuntu or Debian
sudo update-grub
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 kdumpUbuntu or Debian
sudo systemctl stop kdump-tools sudo systemctl disable kdump-tools
Run the following command to restart the system for the changes to take effect.
sudo reboot
Verify the result.
Run the following command to check the kdump status. Confirm that the status is
inactive (dead), which means thekdumpservice has stopped.Alibaba Cloud Linux or CentOS
sudo systemctl status kdump
Ubuntu or Debian
sudo systemctl status kdump-tools
Run the following command to view the grub configuration file.
cat /proc/cmdlineIf the crashkernel configuration is not present in the output, it has been deleted.

Run the following command to view the size of the reserved memory.
cat /sys/kernel/kexec_crash_sizeIf the output is
0, the reserved system memory has been released.