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

Memory leak in TickingTracker

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 23w31a
    • 1.20, 1.20.1 Release Candidate 1, 1.20.1
    • Plausible
    • Performance

      DynamicGraphMinFixedPoint never sets level value higher than levelCount-1. TickingTracker uses levelCount=34:

      public TickingTracker() {
         super(34, 16, 256);
         this.chunks.defaultReturnValue((byte)33);
      }

      and chunks are removed from the internal collection when level is set to value > 33:

      protected void setLevel(long l, int i) {
         if (i > 33) {
            this.chunks.remove(l);
         } else {
            this.chunks.put(l, (byte)i);
         }
      }

      which never happens, so chunks are never removed from TickingTracker.

      No "steps to reproduce" here, because it's not something that can be easily seen in game - it's just a very slow increase in memory usage over a long period of time after exploring different world areas. But it can add up over time on long running servers.

            Unassigned Unassigned
            Barteks2x Bartosz Skrzypczak
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: