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

WorldClient leaks player and painting entities


    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w50a, Minecraft 18w15a, Minecraft 18w20c, Minecraft 1.13-pre1, Minecraft 1.13-pre3, Minecraft 1.13-pre6, Minecraft 1.13-pre8, Minecraft 1.13, Minecraft 18w30a, Minecraft 18w31a, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 19w05a
    • Java 8u141 x64, Windows Server 2016, but it doesn't matter
    • Confirmed

      I've found a memory leak present in all minecraft versions I know

      The problem is, entity added to world by "Spawn Player" Packet (ID 0x05 for 1.12.2), is added to "entityList" HashSet in "WorldClient" (according to MCP mapping) twice with different IDs, first time it added with client-generated entity ID, then correct entity ID is set and it added to same set again (but old one is not deleted because equals() method is based on entity ID)
      The entity added first time will never be removed by "Destroy Entity" packet (ID 0x35 for 1.13)

      Very simple reproduce steps:
      1) Start a server
      2) Let 2 players join the server
      3) One player then should disconnect
      4) There's will be still two players is "entityList"

      I didn't researched if it could cause any real problems, but it's definetely a bug
      Sorry for my english, i'm not native english speaker

      For moderators: I don't know if i'm first who reported bug in code itself, but i think it should be fixed like any other bug

            fry [Mojang] Georgii Gavrichev
            new_sashok724 sashok724
            9 Vote for this issue
            3 Start watching this issue