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

[Performance] Memory Leak of Server Player #651

Closed
pietro-lopes opened this issue Oct 30, 2024 · 1 comment
Closed

[Performance] Memory Leak of Server Player #651

pietro-lopes opened this issue Oct 30, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@pietro-lopes
Copy link

pietro-lopes commented Oct 30, 2024

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

@pietro-lopes pietro-lopes added the triage Newly submitted bug that needs verification label Oct 30, 2024
@iron431 iron431 added bug Something isn't working pending release Feature or Bugfix implemented, and is pending release and removed triage Newly submitted bug that needs verification labels Oct 30, 2024
@iron431
Copy link
Owner

iron431 commented Oct 30, 2024

should be fixed in 3.8.3

@iron431 iron431 closed this as completed Oct 30, 2024
@iron431 iron431 removed the pending release Feature or Bugfix implemented, and is pending release label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants