PocketMine / PocketMine-MP

Legacy PocketMine-MP repository. Head to https://github.com/pmmp for up to date software.
https://www.pocketmine.net/
GNU Lesser General Public License v3.0
1.26k stars 660 forks source link

Fix a horrible entity-related memory leak #4226

Closed dktapps closed 8 years ago

dktapps commented 8 years ago

This commit, simple though it looks, fixes the a horrible memory leak that PocketMine and all its forks of have been suffering from since forever.

EDIT: Further explanation is probably warranted.

The problem here, as briefly as I can summarize it, is that entities are leaked on chunk unload.

Before patch:

After patch:

SOF3 commented 8 years ago

Just to make sure that this works, any proof that this fixes the memory leak problem, please? I mean, for example, is this the only source of memory leak?

{{citation needed}}

dktapps commented 8 years ago

@SOF3 no. This isn't the only leak. However, it was the main one, at least in Genisys.

PM may not suffer as badly as Genisys did as far as I can tell PM mobs don't drop items or exp. But this did have drastic effects. Most Genisys users enjoyed an increase in server uptime from hours to weeks.

dktapps commented 8 years ago

We've only discovered since this was fixed that there are other leaks. It's like peeling an onion.

dktapps commented 8 years ago

I've reworded the commit and updated the title since THE leak is not accurate as stated above.

inxomnyaa commented 8 years ago

Even a way better explaination than on the forks before, nice!

robske110 commented 8 years ago

?

dktapps commented 8 years ago

@robske110 I was told I was wasting my time. Check Telegram