Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Memory Leak of Server #774

Closed
pietro-lopes opened this issue Aug 20, 2024 · 4 comments
Closed

[Bug]: Memory Leak of Server #774

pietro-lopes opened this issue Aug 20, 2024 · 4 comments
Labels

Comments

@pietro-lopes
Copy link

pietro-lopes commented Aug 20, 2024

What happened?

There is a leak of Server on Journeymap instance

Join a game, leave to main menu and server is leaked.

Mod Loader

NeoForge

Minecraft Version

1.21.x

Version

6.0.0

Relevant log output

image

@mysticdrew
Copy link
Member

What is that image suppose to represent? I need a lot more details

@pietro-lopes
Copy link
Author

pietro-lopes commented Aug 20, 2024

This image is a heap dump, showing the Path to GC Roots when I'm at the main menu, after I joined a game and exited.
It is from Eclipse Memory Analyzer.

When we logout/exit to Main Menu some instances needs to be cleared in case you saved like Players, Levels, Server.

Here is Neoforge clearing server instance when server is closed/shutdown:
https://github.com/neoforged/NeoForge/blob/fb8915b8c3bf3220b30d35089b89dcd6a1651f30/src/main/java/net/neoforged/neoforge/server/ServerLifecycleHooks.java#L128

You should listen to ServerStoppedEvent and when it fires you clean your Journeymap instance

@mysticdrew
Copy link
Member

There are no memory leaks, it is just maintaining the server properties which do not change per server instance. Everything else on the server is event driven and state is not maintained. JourneyMap on the server is very minimal.

@mysticdrew
Copy link
Member

It is cleaned up now for next beta release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants