Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Generation thread frees chunks, PHP garbage collector does not #1920

Closed
shoghicp opened this issue Aug 18, 2014 · 7 comments
Closed

Generation thread frees chunks, PHP garbage collector does not #1920

shoghicp opened this issue Aug 18, 2014 · 7 comments

Comments

@shoghicp
Copy link
Member

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

@ghost
Copy link

ghost commented Aug 20, 2014

i think this is the issue im having. hopefully the amazing shoghi can figure it out soon :)

@Huntereb
Copy link

Yeah, I can confirm this as well. You can stop it from occurring as often by lowering the view distance.

@Huntereb
Copy link

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.

@shoghicp shoghicp added this to the Alpha_1.4 milestone Aug 25, 2014
@ghost
Copy link

ghost commented Sep 6, 2014

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.

@ghost
Copy link

ghost commented Sep 19, 2014

is server reload then kill pocketmine PID safe? this is my solution to totally kill pocketmine completely without getting stuck at unloading chunks

@shoghicp
Copy link
Member Author

@iJoshuaHD You are in the wrong issue. Refer to #2046 so all comments here are related to this issue :)

shoghicp added a commit that referenced this issue Sep 22, 2014
@shoghicp
Copy link
Member Author

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

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

No branches or pull requests

2 participants