Try modifying the line in your while loop to read
threads->create( 'new_request', $client )->detach();
It won't fix all the problems, but it does reduce the memory consuption of your proxy substantially. You will still see long term memory growth, but the rate of growth is less than 1% of the unmodified code (based on very unscientific and insubstantial tests!).
In reply to Re: threads hogging memory
by BrowserUk
in thread threads hogging memory
by saskaqueer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |