ModularWarfare - Guns & more

ModularWarfare - Guns & more

923k Downloads

PlayerSnapshot causing EntityPlayer instance leak

MrMks opened this issue ยท 6 comments

commented

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.

commented

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 :)

commented

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

commented

@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.

commented

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

commented

@gameusefly ok, it works now.

commented

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