mojira.dev
MC-252409

Memory statistics within the debug menu contain some unnecessary spaces

The Bug:

Memory statistics within the debug menu contain some unnecessary spaces.

See

[media]

for all occurrences of this issue.

Steps to Reproduce:

  1. Enable the debug menu by hitting the "F3" key.

  2. Look towards the top right of the debug menu and look closely at the memory statistics.

  3. Take note as to whether or not memory statistics within the debug menu contain some unnecessary spaces.

Observed Behavior:

Unnecessary spaces are present.

Expected Behavior:

Unnecessary spaces would not be present.

Code Analysis:

Code analysis by @unknown can be found below.

The following is based on a decompiled version of Minecraft 1.19 Release Candidate 1 using Mojang mappings.

net.minecraft.client.gui.components.DebugScreenOverlay.java

public class DebugScreenOverlay extends GuiComponent {
   ...
   protected List<String> getSystemInformation() {
      ...
      ArrayList arrayList = Lists.newArrayList((Object[])new String[]{String.format("Java: %s %dbit", System.getProperty("java.version"), this.minecraft.is64Bit() ? 64 : 32), String.format("Mem: % 2d%% %03d/%03dMB", l4 * 100L / l, DebugScreenOverlay.bytesToMegabytes(l4), DebugScreenOverlay.bytesToMegabytes(l)), String.format("Allocation rate: %03dMB /s", DebugScreenOverlay.bytesToMegabytes(this.allocationRateCalculator.bytesAllocatedPerSecond(l4))), String.format("Allocated: % 2d%% %03dMB", l2 * 100L / l, DebugScreenOverlay.bytesToMegabytes(l2)), "", String.format("CPU: %s", GlUtil.getCpuInfo()), "", String.format("Display: %dx%d (%s)", Minecraft.getInstance().getWindow().getWidth(), Minecraft.getInstance().getWindow().getHeight(), GlUtil.getVendor()), GlUtil.getRenderer(), GlUtil.getOpenGLVersion()});
      ...

If we look at the above class, we can see that memory statistics within the debug menu contain some unnecessary spaces. This is evident through the following pieces of code:

... String.format("Mem: % 2d%% %03d/%03dMB" ...
... String.format("Allocation rate: %03dMB /s" ...
... String.format("Allocated: % 2d%% %03dMB" ...

Linked issues

Attachments

Comments 6

Please do not file bugs about text spacing or other text errors on the debug screen. Thanks! 🙂

That's completely fine! Thanks for letting me know!

In that case MC-187372 is also invalid, but I guess lack of space is more important/confusing than abundance.

Spoke to the team, they're happy to keep these in their backlog. I would recommend placing any future ones together.

That's fine; thank you very much! We can always add any future problems regarding the text within debug menu to this report. I'm more than happy to do that. Thanks once again!

Can confirm in 1.20.3 Release Candidate 1

Avoma

Fantastime

Confirmed

Platform

Low

Debug

1.18.2, 1.19 Pre-release 5, 1.19 Release Candidate 1, 1.19 Release Candidate 2, 1.19, ..., 22w45a, 1.19.3, 1.19.4, 1.20.1, 1.20.3 Release Candidate 1

23w51a

Retrieved