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 when unloading worlds #212

Closed
LaserSlime opened this issue Jul 28, 2023 · 4 comments · Fixed by #213 or #215
Closed

[BUG] Memory leak when unloading worlds #212

LaserSlime opened this issue Jul 28, 2023 · 4 comments · Fixed by #213 or #215
Assignees
Labels
bug Something isn't working Spigot Spigot specific

Comments

@LaserSlime
Copy link

LaserSlime commented Jul 28, 2023

Describe the bug
The plugin somewhere keeps references to chunks or other elements of worlds even after they are unloaded using Bukkit.unloadWorld by other plugins.

To Reproduce
Steps to reproduce the behavior:

  1. Start a server with VoxelSniper, Spark profiler and a plugin to load/unload worlds
  2. Load, join and unload a few worlds
  3. Run /spark heapdump
  4. Put the generated heapdump into a tool like eclipse mat and go to "Dominator Tree"
  5. You should see lots of instances of ChunkTaskScheduler as well as WorldServer and other world related classes that take up memory (see screenshot)

Expected behavior
If you repeat the same steps without VoxelSniper, this should not happen.

Screenshots
i love it when ChunkTaskScheduler

Desktop (please complete the following information):

  • Minecraft version: 1.19.4
  • Voxelsniper version 8.12.2
  • Server/client software Paper

Additional context
I was told by the paper devs that unloadWorld memory leaks really only happen due to other plugins keeping references to chunks. When I removed all plugins except for one that unloads worlds and spark, it did indeed stop. So I added every single plugin back 1 by 1 and tested and as soon as I added VoxelSniper, I could see lots of ChunkTaskScheduler instances in the heap dump.

@LaserSlime LaserSlime added the bug Something isn't working label Jul 28, 2023
@KevinDaGame KevinDaGame added the Common All versions label Jul 28, 2023
@KevinDaGame
Copy link
Owner

Thanks for the report. We do indeed cache worlds in sime way, I'll look into this when I get the change

@KevinDaGame
Copy link
Owner

KevinDaGame commented Jul 29, 2023

@LaserSlime Could you elaborate on "a plugin to load/unload worlds"? What plugin could we reproduce the issue with?

@KevinDaGame KevinDaGame self-assigned this Jul 29, 2023
@LaserSlime
Copy link
Author

It should happen with any plugin that uses Bukkit.unloadWorld. Maybe try Multiverse?

@KevinDaGame KevinDaGame added Spigot Spigot specific and removed Common All versions labels Jul 29, 2023
@KevinDaGame KevinDaGame linked a pull request Jul 29, 2023 that will close this issue
5 tasks
@KevinDaGame
Copy link
Owner

KevinDaGame commented Aug 5, 2023

I've addressed this issue. The fix will be in the next release

@KevinDaGame KevinDaGame linked a pull request Aug 5, 2023 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Spigot Spigot specific
Projects
None yet
2 participants