Sophisticated Core (Unofficial Fabric port)

Sophisticated Core (Unofficial Fabric port)

1M Downloads

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

JoshieGemFinder opened this issue ยท 1 comments

commented

Describe the bug
The SophisticatedCore class contains a static reference to MinecraftServer in the form of private static MinecraftServer currentServer

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

To fix this memory leak, either:

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

To Reproduce
N/A

Expected behavior
N/A

Screenshots
N/A

Versions
1.21.1-1.2.9.1.140

commented

New version has been released, this should now be fixed.