The `ServerLifecycleHooks` 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`](https://docs.oracle.com/javase/8/docs/api/java/lang/ref/WeakReference.html)