Skip to content

Memory Leak: ServerLifecycleHooks static reference to MinecraftServer #167

@JoshieGemFinder

Description

@JoshieGemFinder

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions