What Are They Up To (Watut)

What Are They Up To (Watut)

25M Downloads

Memory Leak: `WatutModFabric` static reference to `MinecraftServer`

JoshieGemFinder opened this issue ยท 0 comments

commented

Describe the bug
The WatutModFabric class contains a static reference to MinecraftServer in the form of public static MinecraftServer minecraftServer

This field is not set to null when the singleplayer integrated server is closed, causing the now-closed minecraftServer to leak.

To fix this memory leak, either:

  • bind to ServerLifecycleEvents.SERVER_STOPPED and set minecraftServer to null
  • replace the minecraftServer field with a WeakReference

To Reproduce
N/A

latest.log, debug.log or crash report if the other 2 arent possible
N/A

Expected behavior
N/A

Screenshots
N/A

Mod and Minecraft version:

  • Version: MC 1.21.1, Watut 1.21.0-1.2.7

Additional context
N/A