Iron's Spells 'n Spellbooks

Iron's Spells 'n Spellbooks

16M Downloads

[Performance] Memory Leak of Server Player

pietro-lopes opened this issue ยท 1 comments

commented

Observed behaviour

On ATM10 Official Server I asked for a memory heap dump and saw that a bunch of removed projectiles were still stored in dirtyProjectiles.
To add: trackedEntities was empty.

private final HashMap<ResourceKey<Level>, List<Projectile>> dirtyProjectiles = new HashMap<>();

**Click to show Entity List**
Entity Target Owner Tick Count Shot? Removal Reason
irons_spellbooks:magic_missile net.minecraft.server.level.ServerPlayer [id=0x6457c7f40] 1 true DISCARDED
relics:shadow_glaive net.minecraft.world.entity.monster.Phantom [id=0x5fb5551f0] net.minecraft.server.level.ServerPlayer [id=0x5a3c76400] 1 true DISCARDED
irons_spellbooks:comet net.minecraft.server.level.ServerPlayer [id=0x6457c7f40] 1 true DISCARDED
irons_spellbooks:comet net.minecraft.server.level.ServerPlayer [id=0x6457c7f40] 1 true DISCARDED
irons_spellbooks:comet net.minecraft.server.level.ServerPlayer [id=0x6457c7f40] 1 true DISCARDED
irons_spellbooks:comet net.minecraft.server.level.ServerPlayer [id=0x6457c7f40] 1 true DISCARDED
irons_spellbooks:comet net.minecraft.server.level.ServerPlayer [id=0x6457c7f40] 1 true DISCARDED
irons_spellbooks:comet net.minecraft.server.level.ServerPlayer [id=0x6457c7f40] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.EnderMan [id=0x65df82850] net.minecraft.server.level.ServerPlayer [id=0x5dd02a5d0] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.EnderMan [id=0x65df6d990] net.minecraft.server.level.ServerPlayer [id=0x5dd02a5d0] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.EnderMan [id=0x5c5cc0f98] net.minecraft.server.level.ServerPlayer [id=0x5dd02a5d0] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c64c93e0] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.piglin.PiglinBrute [id=0x666453950] net.minecraft.server.level.ServerPlayer [id=0x5c64c93e0] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c64c93e0] 1 true DISCARDED
relics:death_essence org.cyclops.evilcraft.entity.monster.EntityVengeanceSpirit [id=0x635b8fb58] net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true KILLED
relics:death_essence net.minecraft.world.entity.monster.EnderMan [id=0x6634df818] net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true KILLED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true DISCARDED
relics:death_essence org.cyclops.evilcraft.entity.monster.EntityVengeanceSpirit [id=0x635b8fb58] net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true KILLED
relics:death_essence org.cyclops.evilcraft.entity.monster.EntityVengeanceSpirit [id=0x635b8fb58] net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true KILLED
relics:death_essence org.cyclops.evilcraft.entity.monster.EntityVengeanceSpirit [id=0x635b8fb58] net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true KILLED
relics:death_essence org.cyclops.evilcraft.entity.monster.EntityVengeanceSpirit [id=0x635b8fb58] net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true KILLED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true DISCARDED
relics:death_essence org.cyclops.evilcraft.entity.monster.EntityVengeanceSpirit [id=0x6634cd590] net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true KILLED
minecraft:snowball net.minecraft.server.level.ServerPlayer [id=0x5bb050158] 1 true DISCARDED
minecraft:snowball net.minecraft.server.level.ServerPlayer [id=0x5bb050158] 1 true DISCARDED
minecraft:snowball net.minecraft.server.level.ServerPlayer [id=0x5bb050158] 1 true DISCARDED
minecraft:snowball net.minecraft.server.level.ServerPlayer [id=0x5bb050158] 1 true DISCARDED
minecraft:snowball net.minecraft.server.level.ServerPlayer [id=0x5bb050158] 1 true DISCARDED
minecraft:snowball net.minecraft.server.level.ServerPlayer [id=0x5bb050158] 1 true DISCARDED
minecraft:snowball net.minecraft.server.level.ServerPlayer [id=0x5bb050158] 1 true DISCARDED
minecraft:snowball net.minecraft.server.level.ServerPlayer [id=0x5bb050158] 1 true DISCARDED
minecraft:snowball net.minecraft.server.level.ServerPlayer [id=0x5bb050158] 1 true DISCARDED
minecraft:snowball net.minecraft.server.level.ServerPlayer [id=0x5bb050158] 1 true DISCARDED
minecraft:snowball net.minecraft.server.level.ServerPlayer [id=0x5bb050158] 1 true DISCARDED
minecraft:snowball net.minecraft.server.level.ServerPlayer [id=0x5bb050158] 1 true DISCARDED
minecraft:snowball net.minecraft.server.level.ServerPlayer [id=0x5bb050158] 1 true DISCARDED
minecraft:snowball net.minecraft.server.level.ServerPlayer [id=0x5bb050158] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5a3cd28b8] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5a3cd28b8] 1 true DISCARDED
relics:death_essence org.cyclops.evilcraft.entity.monster.EntityVengeanceSpirit [id=0x63fee4390] net.minecraft.server.level.ServerPlayer [id=0x5a3cd28b8] 1 true KILLED
relics:death_essence net.minecraft.world.entity.monster.Zombie [id=0x5f34b4978] net.minecraft.server.level.ServerPlayer [id=0x5a3cd28b8] 1 true DISCARDED
relics:death_essence org.cyclops.evilcraft.entity.monster.EntityVengeanceSpirit [id=0x63fee4390] net.minecraft.server.level.ServerPlayer [id=0x5a3cd28b8] 1 true KILLED
relics:death_essence net.minecraft.world.entity.monster.Zombie [id=0x5f34b4978] net.minecraft.server.level.ServerPlayer [id=0x5a3cd28b8] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.animal.Squid [id=0x68482efa0] net.minecraft.server.level.ServerPlayer [id=0x5c64c93e0] 1 true DISCARDED
immersiveengineering:revolver_shot 1 true DISCARDED
immersiveengineering:revolver_shot 1 true DISCARDED
immersiveengineering:revolver_shot 1 true DISCARDED
immersiveengineering:revolver_shot 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Pillager [id=0x6566d9bc0] net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Pillager [id=0x5f699c2e8] net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true DISCARDED
irons_spellbooks:guiding_bolt net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
irons_spellbooks:guiding_bolt net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5b19fc3e0] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5c6077088] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5ba8e4300] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Creeper [id=0x5fd4541c0] net.minecraft.server.level.ServerPlayer [id=0x5dd02a5d0] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Creeper [id=0x65fa7b4a0] net.minecraft.server.level.ServerPlayer [id=0x5dd02a5d0] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Creeper [id=0x65f139f30] net.minecraft.server.level.ServerPlayer [id=0x5dd02a5d0] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5ba8e4300] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5ba8e4300] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5ba8e4300] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5ba8e4300] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5ba8e4300] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5ba8e4300] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5ba8e4300] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Creeper [id=0x64519b620] net.minecraft.server.level.ServerPlayer [id=0x5dd02a5d0] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Husk [id=0x5f160aef0] net.minecraft.server.level.ServerPlayer [id=0x5dd02a5d0] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Creeper [id=0x663540558] net.minecraft.server.level.ServerPlayer [id=0x5dd02a5d0] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Creeper [id=0x65a2798e8] net.minecraft.server.level.ServerPlayer [id=0x5dd02a5d0] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Creeper [id=0x663540558] net.minecraft.server.level.ServerPlayer [id=0x5dd02a5d0] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Skeleton [id=0x5e618f6e0] net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Skeleton [id=0x5e618f6e0] net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
pneumaticcraft:vortex 1 true DISCARDED
pneumaticcraft:vortex 1 true DISCARDED
pneumaticcraft:vortex 1 true DISCARDED
pneumaticcraft:vortex 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x5ba8e4300] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Silverfish [id=0x635b8a028] net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Silverfish [id=0x635b83220] net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Silverfish [id=0x65e891ae0] net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Silverfish [id=0x5def99268] net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Silverfish [id=0x5def9e658] net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
minecraft:firework_rocket net.minecraft.server.level.ServerPlayer [id=0x5b1dcfdb0] 0 false DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Guardian [id=0x65e87fab8] net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
relics:death_essence net.minecraft.world.entity.monster.Guardian [id=0x6635228c8] net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
ars_nouveau:spell_proj net.minecraft.server.level.ServerPlayer [id=0x61dad7f30] 1 true DISCARDED
minecraft:firework_rocket net.minecraft.server.level.ServerPlayer [id=0x5b1dcfdb0] 0 false DISCARDED
minecraft:firework_rocket net.minecraft.server.level.ServerPlayer [id=0x5b1dcfdb0] 0 false DISCARDED

Expected behaviour

Store projectiles as weak reference or check if it is removed and remove from map

Steps to reproduce

I don't know how to reproduce as this was a memory heap dump.

Server Type

Dedicated Server

Crashlog

No response

Iron's Spells N Spellbooks version

v1.21-3.8.2

Forge version

1.21.1 - 21.1.72

Other mods

ATM10 Modpack

commented

should be fixed in 3.8.3