Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-263119

Minecraft keeps previously loaded textures in memory even if the size of the texture atlas shrinks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • None
    • 1.20 Release Candidate 1, 1.20.1
    • None
    • Confirmed
    • Resource Packs, Textures and models

      The bug

      If, through changing or reloading resource packs, the dimensions of a texture atlas increase, and then said resource pack changes are reset such that we return to the initial resource pack settings from first loading the game session, the size of said atlas will remain in its increased state rather than reverting to its prior size.

      This can cause performance issues when reloading/changing resource packs after the fact since the game is keeping unused texture data in memory. For example, if a high-resolution resource pack is applied, but then removed, all of those high resolution textures are still stored in memory even though the game doesn't make use of them at all.

      How to reproduce

      1. Download the attached resource pack
      2. Apply the attached resource pack (you should only have two resource packs active: the default resources and the attached one)
      3. Close the game
      4. Load up the game again, keeping an eye on the log output to see how big the generated minecraft:textures/atlas/chest.png-atlas is
      5. Enter a world then use F3+S to dump the textures
      6. Move the created "debug" folder in the screenshots folder somewhere else
      7. Take off the attached resource pack so that you' now only have the default resources
      8. Now apply the attached resource pack again, keeping an eye on the output log
      9. Do F3+S again to dump the debug textures

      Expected results

      chest.png-atlas would be 32x16, as it only contains two 16x16 texture files.

      Actual results

      This is only true when first starting the game. Once we go back to the vanilla resources and then reapply the pack, it becomes 256x256; the vanilla chest textures remain and are only partially overwritten, rather than getting the 32x16 atlas we first got.

        1. IFDEFAULTISUSEDBEFORE-minecraft_textures_atlas_chest.png_0.png
          19 kB
          Connor Steppie
        2. WHENFIRSTSTARTING-minecraft_textures_atlas_chest.png_0.png
          0.4 kB
          Connor Steppie

            Unassigned Unassigned
            Awesoman3000 Connor Steppie
            Votes:
            7 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: