Since Minecraft 1.8 (or maybe earlier), I've been starting my home Minecraft Server with the GUI so that I can see which of my kids are connected. I start the server from a BASH terminal using:
java -Xmx1024M -Xms1024M -jar minecraft_server.jar
(Java SE version is 1.8.0_91)
When I upgraded to Minecraft Server 1.10, I noticed that the CPU usage was always high, even when no players are connected.
To compare, I tried running the exact same world using both the GUI and NOGUI and noting the CPU usage. Here are my results:
Minecraft Server 1.8.4
nogui = hovers between 0.5% and 6% CPU
with GUI = hovers between 49% and 80% CPU
Minecraft Server 1.9.4
nogui = hovers between 0.8% and 8% CPU
with GUI = hovers between 41% and 80% CPU
Minecraft Server 1.10.2
nogui = hovers between 0.8% and 6% CPU
with GUI = hovers between 48% and 95% CPU
Clearly the GUI is using far more CPU than the "nogui" option, but why? It's not exactly rendering any fancy graphics and there doesn't seem to be a reason for the simple GUI to need so much CPU compared to "nogui". Does showing the "Memory use" and the "Avg tick" really need so much CPU to be consumed?
Linked issues
Comments 8
Ha! If you look at that other ticket then you'll see that I was instructed to open this new ticket! 🙂
Can you check with your colleague FVbiko (https://bugs.mojang.com/secure/ViewProfile.jspa?name=FVbico) and find out why they thought that mine was a separate issue?
Thanks.
Mind adding -XX:+DisableExplicitGC directly after 'java' (before '-jar') and reporting back on CPU usage?
The GUI runs a GC every tick.
My 1.11 server was using something ridiculous like 1/4 of my CPU even with no players, but when I added -XX:+DisableExplicitGC it only used 0-1%. Also what is a GC?
GC is garbage collection.
Is this still an issue in the most recent versions (currently that is 1.12.2, or the latest 1.13 development snapshot 18w07c) of Minecraft?
This issue has actually already been reported. Thank you for the information though, and feel free to add any relevant info to MC-105138.