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

Non full chunks in cache memory "semi-leak"

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Fixed
    • 1.15.2, 1.16.2, 1.16.3, 1.16.4 Pre-release 1, 20w46a, 20w49a
    • 1.18 Pre-release 3
    • None
    • Plausible
    • Performance
    • Normal

    Description

      See patch: https://github.com/PaperMC/Paper/commit/cf82dad399cf3bfb6b4cdd54f264d4563633940e

       

      For any full status chunk on disk that is loaded, a lambda is created in loadChunks to load the Entity data from the NBT once it reaches full.

       

      This lambda is holding a reference to every variable in this functions scope, including the full chunks NBT compound...

      So for every chunk we load into the cache but never reach full status, this scope is leaked and holds a lot of memory.

      The Lambda needs to be created outside of the functions scope, as well as make a new NBT Tag compound and copy the Entities and TileEntities sections to it, so the only NBT that is "held" in a non full status is those 2 NBTTagList's.

      Or ideally, extract the NBT state out at this point of time in a safe way so no NBTTagCompound's have to linger.

      Attachments

        Issue Links

          Activity

            People

              boq [Mojang] Bartosz Bok
              aikar Aikar
              Votes:
              16 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                CHK: