BIG MEMORY LEAK [URGENT]
When a world unloads meg doesn't remove ANYTHING, this was fun until couple updates ago where you removed some methods that allowed us to do it. Without removing everything from MEG on the world unload it causes huge memory leaks and ends up crashing at the end.
This was the method I was using before and if you need a .hprof or a speark heapsummary I'll gladly send one in private DMs. (My discord: xdLulux)
Method I used that worked until now:
int entityCount = 0;
for (EntityDataTrackers.Tracker tracker : ModelEngineAPI.getAPI().getDataTrackers().getAvailable()) {
for (Map.Entry<UUID, IEntityData> entry : tracker.getDataTrackers().entrySet()) {
IEntityData entityData = entry.getValue();
if (entityData.getLocation().getWorld().getName().equalsIgnoreCase(bukkitWorld.getName())) {
this.plugin.getLogger().warning("Found IEntityData " + entry.getKey() + " in world " + bukkitWorld.getName() + " in EntityTracker.");
tracker.removeEntityData(entry.getKey());
entityCount++;
}
}
}
this.plugin.getLogger().info("Removed " + entityCount + " IEntityData from world " + world.getName());
int modelCount = 0;
for (ModelUpdaters.Updater updater : ModelEngineAPI.getAPI().getModelUpdaters().getAvailable()) {
for (UUID modelUUID : updater.getAllModeledEntityUUID()) {
ModeledEntity modeledEntity = updater.getModeledEntity(modelUUID);
if (modeledEntity.getBase().getLocation().getWorld().getName().equalsIgnoreCase(bukkitWorld.getName())) {
this.plugin.getLogger().warning("Found ModeledEntity " + modelUUID + " in world " + bukkitWorld.getName() + " in ModelUpdater.");
updater.removeModeledEntity(modelUUID);
modelCount++;
}
}
}
this.plugin.getLogger().info("Removed " + modelCount + " ModeledEntity from world " + world.getName());
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information