
Memory Leak: `WatutModFabric` static reference to `MinecraftServer`
JoshieGemFinder opened this issue ยท 0 comments
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 setminecraftServer
to null - replace the
minecraftServer
field with aWeakReference
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