The EC2 server shut down


The server freezes completely when trying to run a jar file compiled with dependencies of the spring boot framework. Actions performed

  1. Java 17 (openjdk 17.0.9) was previously installed using yum via putty
  2. The jar files have been copied to the /opt/pis/ folder on the server, collected for spring boot using WinSCP. The files were checked on the local machine - everything is started via the java -jar <filename> command.
  3. The java -jar <file name> command is executed using putty. The terminal displays messages that spring is running and has started initialization, but it freezes at some stage. At the same time, access via ssh (in putty), sftp (WinSCP) and the MySQL Workbench client is lost. Through the AWS console, the browser also writes an error that it cannot connect. There should be enough memory, since the jar running on the local machine takes up 221 MB of memory. There are no signs on the instance panel in the AWS console that the server is frozen, but there is no access to it at all.

I tried to do a Reboot for Instance - there is no reaction. Next, I tried to make a stop instance, and then start instance - the server rebooted, but changed the public ip address. After that, access appeared again. I tried to start the jar again, the server has been frozen again.

How can I find out the reason why the server is freezing and shutting down? According to the information in the console, it is not clear. Or how i can fix it ?

asked 5 months ago186 views
2 Answers


It should be possible to check the EC2 system log by following the steps in the document below.
Check this log and if you see an OOM error, there is a high possibility that there is insufficient memory, so please try increasing the instance size.

We also recommend checking the EC2 metrics to see if there are any unnatural parts.

profile picture
answered 5 months ago

At the and of the day we reinstalled instance with Amazon Linux (before Linux Red hut was installed on our server). We also tried to use containers with Docker - but it did not help - Java jar file was freezing. Now jar file is up and running without any problems directly without containers. We installed also Java 21 instead of Java 17

answered 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions