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 of Client Player #556

Open
pietro-lopes opened this issue Aug 24, 2024 · 5 comments
Open

[Bug] Memory Leak of Client Player #556

pietro-lopes opened this issue Aug 24, 2024 · 5 comments
Labels
triage Newly submitted bug that needs verification

Comments

@pietro-lopes
Copy link

Observed behaviour

Continuation of #549

Now it is holding on ClientMagicData on 3.4.5

image

Expected behaviour

No leak

Steps to reproduce

Same as old issue.

Server Type

Single Player

Crashlog

No response

Iron's Spells N Spellbooks version

3.4.5

Forge version

1.21.1 - 21.1.22

Other mods

No response

@pietro-lopes pietro-lopes added the triage Newly submitted bug that needs verification label Aug 24, 2024
@iron431
Copy link
Owner

iron431 commented Aug 24, 2024

The SpellSelectionManager and the SpellBarOverlay do not store a reference to ClientMagicData, nor does any class

@pietro-lopes
Copy link
Author

ClientMagicData stores spellSelectionManager which stores player

@iron431
Copy link
Owner

iron431 commented Aug 25, 2024

@pietro-lopes
Copy link
Author

I see, but that does not include dimension change or death. Both triggers player creation again.
We don't have something similar to PlayerEvent.StopTracking on client side, so I don't know which event should be used for both cases (player dim change and death)

I would just not store player and replace player with Minecraft.getInstance().player, this is not an expensive call, unless there is something I'm missing that you shouldn't use.

@pietro-lopes
Copy link
Author

OH, I forgot about ClientPlayerNetworkEvent.Clone, you can listen to that to replace/clear player.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Newly submitted bug that needs verification
Projects
None yet
Development

No branches or pull requests

2 participants