Page 1 of 1

stream_context_create memory leak

Posted: Thu Feb 05, 2009 11:11 am
by georgewr3
stream_context_create seems to have a memory leak. This has been reported (http://bugs.php.net/bug.php?id=40257) but marked bogus for some reason.

I am using the code almost verbatim from this:
http://netevil.org/blog/2006/nov/http-p ... thout-curl

Running ps lax shows this code consuming more memory until the memory is exhausted.

I'm at version 5.2.6 already. Anyone know if it's been fixed or a workaround to the stream_context_create call?

Re: stream_context_create memory leak

Posted: Fri Oct 16, 2009 9:31 am
by robganly
hi there,

i'm having the same problem. i have traced the leak to a class that is using the stream_context_create function.

it is used in an import script for inputting data into an instance of solr, but is dying after tens of thousands of records (and i need it to be rock solid as it has to work on millions eventually!).

anyhow outputting memory_get_usage within a loop where the stream_context_create function is being used shows memory increasing with each iteration until the max is reached.

does anyone have any ideas how to solve this? it is pretty urgent!

best,

rob ganly