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

PlayerSnapshot causing EntityPlayer instance leak #38

Open
MrMks opened this issue Aug 24, 2022 · 6 comments
Open

PlayerSnapshot causing EntityPlayer instance leak #38

MrMks opened this issue Aug 24, 2022 · 6 comments

Comments

@MrMks
Copy link

MrMks commented Aug 24, 2022

I checked the heapdump with memory analyze tool (by Eclipse), and it shows that there is a reference link to the instance of EntityPlayer.
L$(2X8STK0`B 11F)V%PO{W

And then i checked the code, it seems that there is no methods to remove out-of-dated instances.

So, i think it must be a memory leak issue.

@gameusefly
Copy link

hey, i created a branche "fixplayersnapshot" on my fork (https://github.com/StateMC/ModularWarfare/tree/fixplayersnapshot)
Please tell me if my fix work, then i will create a pull request to share the fix with everyone :)

@Protoxy22
Copy link
Member

Protoxy22 commented Aug 24, 2022

Yes, you are both right.
When a player leave the world, the PlayerData and the latest 20 hitbox snapshots stills exists on the hashmap.

@gameusefly If your commit is working in server-side/client-side feel free to make a pull request to solve the problem.
Thanks

@MrMks
Copy link
Author

MrMks commented Aug 25, 2022

@gameusefly I tested it in a forge only env, and it works well on server but doesn't on client.

After i leave the game, clientSideDatas are still there.

@gameusefly
Copy link

@MrMks i pushed a fix for that, feel free to test it :)

@MrMks
Copy link
Author

MrMks commented Aug 26, 2022

@gameusefly ok, it works now.

@gameusefly
Copy link

The EntityPlayer leak is now fixed in the newest version of the stable branche

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants