Generation thread frees chunks, PHP garbage collector does not #1920
Comments
i think this is the issue im having. hopefully the amazing shoghi can figure it out soon :) |
Yeah, I can confirm this as well. You can stop it from occurring as often by lowering the view distance. |
Is there any current work around to this? It's happening incredibly frequently, I can't keep the server running but for about an hour before the entire thing just locks up and becomes unusable. |
Confirmed for my test server in preparation for my public server, me and my friends get stuck on the building terrain loader and then nothing happens for years. |
is server reload then kill pocketmine PID safe? this is my solution to totally kill pocketmine completely without getting stuck at unloading chunks |
@iJoshuaHD You are in the wrong issue. Refer to #2046 so all comments here are related to this issue :) |
A new setting has been added to pocketmine.yml to choose whether to use threaded generation or synchronous chunk generation (default synchronous, read pocketmine.yml for more info). I'll be closing this since it's a bug in PHP itself |
After chunks are generated/populated and sent to the main thread, they are freed from internal arrays so the PHP garbage collector can free them from memory.
But this doesn't work. The memory usage increases as each new chunk is generated, even when they are found nowhere in the internal arrays. This causes a thread crash due to hitting the memory limit, that has also the side effect of PHP using the more memory that was assigned (other threads have this same issue).
The text was updated successfully, but these errors were encountered: