[MC-105845] Memory usage graph of server GUI not drawing Created: 04/Aug/16  Updated: 15/Oct/16  Resolved: 15/Oct/16

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w41a
Fix Version/s: Minecraft 16w42a

Type: Bug
Reporter: [Mod] Marcono1234 Assignee: [Mojang] Grum (Erik Broes)
Resolution: Fixed Votes: 0
Labels: GUI, memory, server

Attachments: PNG File Server GUI 1.0 RC2.PNG     PNG File Server GUI 1.10.2.PNG    
Confirmation Status: 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();
    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()));

Comment by [Mod] Marcono1234 [ 11/Aug/16 ]

Why is this marked as "Won't fix"?

Then at least remove the following:

  • net.minecraft.server.gui.StatsComponent.paint(Graphics)
  • net.minecraft.server.gui.StatsComponent.values
  • net.minecraft.server.gui.StatsComponent.vp
  • repaint() call of net.minecraft.server.gui.StatsComponent.tick()
Comment by [Mod] Marcono1234 [ 11/Aug/16 ]

[Mojang] Grum (Erik Broes), for a short moment I thought your behaviour regarding closing reports changed :/

Please at least comment "Will be removed" and then I at least know why it was closed, because I am pretty certain that leaving kind of dead code is not "Won't fix"

Generated at Thu Feb 21 01:57:12 CST 2019 using Jira 7.11.2#711002-sha1:fdc329dee91471a641faabfe39b5ff8c0a5b3f66.