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

Client leaks GPU / OS memory when reloading textures

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.15.2, 20w21a, 20w22a, 1.16 Pre-release 1, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16 Pre-release 5, 1.16 Pre-release 6, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w27a, 20w28a, 20w29a, 20w30a, 1.16.2 Pre-release 1, 1.16.2 Release Candidate 1, 1.16.2 Release Candidate 2, 1.16.2, 1.16.3 Release Candidate 1, 1.16.3, 1.16.4 Pre-release 1, 1.16.4 Pre-release 2, 1.16.4 Release Candidate 1, 1.16.4, 20w46a, 20w48a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w07a, 21w11a, 1.17 Pre-release 2, 1.17.1, 22w11a, 1.19 Pre-release 4
    • Confirmed
    • Performance
    • Normal
    • Platform

      The bug

      Minecraft never deletes textures of the skins, causing it to stay loaded forever.

      How to reproduce

      1. Log in into any multiplayer server/give yourself bunch of player heads
      2. Log off
      3. Reload resources (optionally, just to provde that it does not solve the problem)
      4. Acquire heap dump: textures remain loaded

      Affects all Minecraft versions starting at least from 1.12.x.

      Code analysis

      When textures are reloaded (official mappings are used), net.minecraft.client.renderer.texture.TextureManager releases all textures it has, but never deletes skins, because their textures are not missing, causing them to load back in.
       

                  while (iterator.hasNext()) {
                      entry = iterator.next();
                      resourceLocation = entry.getKey();
                      abstractTexture = entry.getValue();
                      if (abstractTexture == MissingTextureAtlasSprite.getTexture() && !resourceLocation.equals(MissingTextureAtlasSprite.getLocation())) {
                          iterator.remove();
                      }
                      else {
                          abstractTexture.reset(this, resourceManager, resourceLocation, executor2);
                      }
                  }
      

      Heap screenshot:

            Unassigned Unassigned
            __xDark __xDark
            Votes:
            21 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              CHK: