Uploaded image for project: 'Minecraft'
  1. Minecraft
  2. MC-105845

Memory usage graph of server GUI not drawing

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w41a
    • Fix Version/s: Minecraft 16w42a
    • Labels:
    • Confirmation Status:
      Confirmed

      Description

      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();
      }
      

        Attachments

          Activity

            People

            • Assignee:
              grum [Mojang] Grum (Erik Broes)
              Reporter:
              marcono1234 [Helper] Marcono1234
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                CHK: