I created a Minecraft server on my computer, but it keeps crashing with the message "./start.sh: line 2: 2885662 Killed
java -Xmx 6G -Xms 1024M -jar fabric-server-launch.jar nogui". I would like to know how to fix this, and if there is any way to make it automatically restart when it crashes.
I am running Ubuntu with 8 gigabytes of ram and a ryzen 3 CPU. Just let me know if you need more information.
Edit: I forgot to mention a few things. The number after where it says line 2 can change. It always has the same amount of digits and it always starts with a 2. The crashes happen most often when a player leaves the server. They also sometimes happen when there is no one in the server for a while. When this happens, it will say something like a tick took 60s and it is interpreting that as if the server crashed, then it gives me the same message as earlier. Lastly sometimes it gives me that message immediately after starting the server.