Bug Closed · Resolved

Memory Leak when using MythicMobs and ModelEngine with multiple worlds

#4963 opened by Unknown 2 years ago

Unknownreported this bug

Summary

I am creating multiple worlds, spawning mythic mobs there and unloading the world there. After around 2h, my 8gb server is running out of memory. I am creating around 1 map every 5-10 seconds.

Steps to reproduce

Create new empty world, paste schematic there, spawn mobs (around 100-200), delete all entities there with entity.remove() and then unload the world. Some mobs keep getting in the memory as in the screenshot and keep the world in the memory causing the memory leak

Current behavior

thats what i wrote in reproduce steps

Intended correct behavior

mobs should be removed from the list when the world is unloaded or perform a check every minute or so to remove them if the world was deleted

Server log file

nothing interesting there, just a normal out of memory exception but I appended heap dump screenshots here

Debug log snippet

same as server log file

Proposed fixes

either they are sometimes not removed when the world is unloaded/deleted -> fix there or perform a check every 10-20 seconds to remove activemobs that are in a deleted or unloaded world. the entity of the activemob is probably already removed so that might also work to check

[Legacy attachment omitted] [Legacy attachment omitted] [Legacy attachment omitted] [Legacy attachment omitted]

Unknowncommented

MythicMob#getLocation().getWorld().isLoaded() also returns true even while the world is not loaded anymore

debugData.put( "mythicMobs", MythicBukkit.inst().getMobManager().getActiveMobs().stream().map(ActiveMob::getMobType).collect(Collectors.joining(", ")));

[Legacy attachment omitted] [Legacy attachment omitted]

and btw: in all the heap dumps, i deleted all worlds and mobs, so there should be nothing left but seems that there are

Unknowncommented

I have the same problem, what tool are you using, I need that tool

Unknowncommented

Can you try the latest build and see if this is fixed?

Unknowncommented

Closing due to inactivity and major version changes since posting. If this issue is still present, re-open this issue with a modern-version server log, configs used to test and steps to reproduce.

Sign in to join the discussion.