Memory statistics within the debug menu contain some unnecessary spaces
The Bug:
Memory statistics within the debug menu contain some unnecessary spaces.
See MC-252409 - Analysis.png
for all occurrences of this issue.
Steps to Reproduce:
- Enable the debug menu by hitting the "F3" key.
- Look towards the top right of the debug menu and look closely at the memory statistics.
- 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 [Mod] Avoma 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" ...
2022-06-02, 11:01 AM
2023-12-12, 09:22 AM
2023-12-12, 09:22 AM
3
6