-
Notifications
You must be signed in to change notification settings - Fork 503
Threaded Memory leak #681
Comments
I've had same similar issue for months, too bad I have zero knowledge about C to fix this. I was hoping krakjoe has more time to fix this but sadly the author is just soo busy ^^. I can understand, but this extension is so useful for those that want to use PHP for simple daemons and have no knowledge or will to learn C/C++/C# P.S.: I can't use extension for that fact which is very sad =( |
so this did fix the issue, I can't test right now cause I kinda removed the threading code? |
Hi guys, I've noticed the memory leak too. I'm using PHP 7.1 with pthreads from master branch cloned on april 27th.
I get memory usage from "ps aux". Memory used just after starting new worker thread: Memory use when executed as it is: When I uncomment the commented code, i.e. wait for previous work to be done before stacking next I get significantly less memory used, but still growing indefinitely, when looping forever. When I create my own work class which stores some initial data in it's constuctor, the memory is consumed more. I hope this helps a bit to identify source of the issue. |
So I just realized fix from @sirsnyder is not in the master. I tried his fork and it is much better. When stacking work sequentially (i.e. next only when the previous is done) memory usage remains constant. What is IMHO not correct, is that when the worker thread is shut down, memory is not freed. |
PR #688 has now been merged into master, so this should be fixed now. |
How to destroy Threaded?
The above code is running, the memory will continue to rise.
The text was updated successfully, but these errors were encountered: