-
Bug
-
Resolution: Fixed
-
Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w41a
-
Confirmed
The bug
In earlier versions like 1.0 RC2 (server file) the Minecraft server GUI displayed the memory usage over time
In the latest versions of the server the memory usage graph remains empty.
The reason
The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.
The reason for this is that the memory usage values are not stored in the array net.minecraft.server.gui.StatsComponent.values which is later used for drawing the graph. Therefor the values remain 0 and nothing is drawn.
This could be fixed by adding the code which existed in 1.0 RC2 back to the method net.minecraft.server.gui.StatsComponent.tick():
private void tick() { long i = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); System.gc(); this.msgs[0] = "Memory use: " + i / 1024L / 1024L + " mb (" + Runtime.getRuntime().freeMemory() * 100L / Runtime.getRuntime().maxMemory() + "% free)"; this.msgs[1] = "Avg tick: " + FORMATTER.format(this.mean(this.server.tickTimeArray) * 1.0E-6D) + " ms"; // Added this line this.values[(this.vp++ & 255)] = ((int)(i * 100L / Runtime.getRuntime().maxMemory())); this.repaint(); }