DBServer crashed due to Out of Memory – create swap space

Home » dbserver » DBServer crashed due to Out of Memory – create swap space
dbserver, Java, Server Issue No Comments

18/08/2026: Also see Confluence article here – Adding Swap Space to an EC2

When server is out of physical memory or swap space it can cause dbserver to crash. In fact it is likely multiple dbservers will crash.

When this occurs JVM will leave behind a dump file called “hs_err_pidxxxxxx.log” where xxxxxx is the process id.

Make sure the server has enough physical memory – don’t over crowd the server with too many dbservers.

Also, it is possible that a low disk space can cause same problem due to unable to create swap space. So make sure server has enough disk space.
(NOTE – aws amazon linux ec2 instance may not have swap enabled. To create swap space read this article)

sudo dd if=/dev/zero of=/swapfile bs=1G count=4
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
swapon -s

Then enable the swap file at boot time by editing the /etc/fstab file:

sudo vi /etc/fstab

/swapfile swap swap defaults 0 0

More info:

  • https://itsfoss.com/create-swap-file-linux/