On 11.07.2008 15:04, Pierre Joye wrote:
Hi Tony,

News?

btw, is it testable?

Yes, you can reproduce it using this script:
<?php

for ($i = 0; $i < 100; $i++) {

   $context = $opts = array(
       'http'=>array(
           'method'=>"GET" /* whatever */
       )
   );

   $context = stream_context_create($opts);
   $fp = fopen(dirname(__FILE__)."/test.php", "r", false, $context);
   fclose($fp);
   unset($context); /* after that refcount should be 0 and free() should be 
called */
   var_dump(memory_get_usage()); /* you should not see memory usage increasing 
*/
}

?>

Without the patch, you shall see constant growth of memory usage, even though 
all variables are destroyed.
This happens because stream contexts are (i.e. were) freed only on shutdown.

--
Wbr, Antony Dovgal

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to