mojira.dev
MC-263430

Memory leak in TickingTracker

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.

Linked issues

Comments 2

To make the bug more effective, please include step to reproduce:

Steps to Reproduce:
Step 1:
Step 2:
Step 3:

Observed Results:
[Describe what happens]

Expected Results:
[Describe what should happen]

For memory leaks that's generally not needed, just a clear indication how memory leaks, which a code analysis does.

Barteks2x

(Unassigned)

Plausible

Performance

memory-leak

1.20, 1.20.1 Release Candidate 1, 1.20.1

23w31a

Retrieved