I was updating my server from 1.15.2 to 1.16.2, going through the usual steps. It took much longer than usual to prepare the spawn area, and after one or two minutes of being up, the server crashed with this message in the command prompt:
[16:16:22] [Server Watchdog/FATAL]: A single server tick took 60.37 seconds (should be max 0.05)
[16:16:22] [Server Watchdog/FATAL]: Considering it to be crashed, server will forcibly shutdown.
[16:16:22] [Server Watchdog/ERROR]: This crash report has been saved to: C:\Users\Nick\Documents\Fun Stuff\Minecraft\Server\.\crash-reports\crash-2020-08-11_16.16.22-server.txt
I attached the related crash report. I've attempted to redownload a new server.jar file multiple times and tried a fresh download on a different machine, created a new world, and experienced the exact same issue.
I found a couple threads on multiple forums describing the same issue, including this bug report with the same error I got when using the server gui:
[01:21:53 INFO]: Generating keypair
[01:21:53 ERROR]: Exception handling console input
java.io.IOException: The handle is invalid at java.io.FileInputStream.readBytes(Native Method) ~[?:1.8.0_261] at java.io.FileInputStream.read(Unknown Source) ~[?:1.8.0_261] at java.io.BufferedInputStream.read1(Unknown Source) ~[?:1.8.0_261] at java.io.BufferedInputStream.read(Unknown Source) ~[?:1.8.0_261] at sun.nio.cs.StreamDecoder.readBytes(Unknown Source) ~[?:1.8.0_261] at sun.nio.cs.StreamDecoder.implRead(Unknown Source) ~[?:1.8.0_261] at sun.nio.cs.StreamDecoder.read(Unknown Source) ~[?:1.8.0_261] at java.io.InputStreamReader.read(Unknown Source) ~[?:1.8.0_261] at java.io.BufferedReader.fill(Unknown Source) ~[?:1.8.0_261] at java.io.BufferedReader.readLine(Unknown Source) ~[?:1.8.0_261] at java.io.BufferedReader.readLine(Unknown Source) ~[?:1.8.0_261] at zg$1.run(SourceFile:89) [server.jar:?]
I followed the instructions in that thread, opening from the command prompt only for the issue to repeat itself.
When I tried to use the command prompt to allocate more RAM to the server to see if that would solve it, it seemed like it tried to use up everything I gave it and more, throwing these errors:
C:\Users\Nick\Documents\Fun Stuff\Minecraft\Server>java -Xmx2G -jar server.jar --nogui
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
C:\Users\Nick\Documents\Fun Stuff\Minecraft\Server>java -Xmx3G -jar server.jar --nogui
Error occurred during initialization of VM
Could not reserve enough space for 3145728KB object heap
C:\Users\Nick\Documents\Fun Stuff\Minecraft\Server>java -Xmx4G -jar server.jar --nogui
Invalid maximum heap size: -Xmx4G
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Let me know if there's any more information I can provide
Related issues
duplicates
Attachments
Comments


Thank you for your report!
However, we are already tracking this issue, and this report is a Duplicate of MC-63590, which has been marked as Works as Intended - this is an intentional game feature. If you have a different opinion, please visit the Feedback website.
Read the moderator note on that report for more information.
Please use the search function in the future to prevent duplicate reports.
Quick Links:
π Issue Guidelines β π Community Support β π§ Customer Support β βοΈ Feedback and Suggestions β π Game Wiki
π¬ Mojira Subreddit β π¬ Mojira Discord

@galaxy_2alex Thanks for linking the duplicate! Turning off the watchdog has stopped the crashes, but has not done anything to solve the issue of not being able to allocate more memory, nor does that report thread mention anything about it.
This reportΒ seems to have a similar issue, but was marked invalid for being technical support?
While this report has the exact same combination of server and memory allocation issues, but was linked to the same duplicate I was. This was the only resolution from the user I can see, but I don't know how to tell if I'm having the same problem they were:
I found out, that my DMZ host was changed from 0 to 12. I only had to change the host back to 0 and open my 5598 port. I agree, that it is a duplicate, but everything was looking fine.
After having the same inability to allocate more RAM and running the server for about five minutes, the average tick had stabilized at ~500 ms, and after about 25 minutes, it had gone down to a playable 50 ms, though that is still a good deal higher than it was before updating, making me feel like is a software bug and not a technical issue?
Perhaps notably I've always the gui to start my server because it's easier and I've never used the console to do it before this point, but still have never had lag of this kind.
If this is indeed a technical issue, then thank you for being patient and I'm sorry for taking up your time.
Edit: after leaving the server and rejoining, I was almost immediately kicked with this error:
[13:39:44 INFO]: Smithy876 lost connection: Internal Exception: java.lang.OutOfMemoryError: Java heap space

That error means that there isn't enough RAM free on the device, or not enough is assigned.