After some further tests. I discovered that occasionally I do still get a 
memory leak in PHP 5.3. I using the $feed->_destruct method prior to unsetting 
$item and $feed and creating a new SimplePie object, as shown in the wiki:

http://simplepie.org/wiki/faq/i_m_getting_memory_leaks

$feed->__destruct(); // Do what PHP should be doing on it's own.
unset($item); 
unset($feed); 

No ideas?

-Tim

 

--- In simplepie-support@yahoogroups.com, "tlhmh1" <tlh...@...> wrote:
>
> I'm aware of the memory leak issues with PHP 5.2 and under, but I suspect 
> these same errors may be causing problems in PHP 5.3.
> 
> I'm currently using SimplePie to process hundreds of feeds. After anywhere 
> between 30 and 300 feeds, I start getting the following:
> 
> "Warning:  curl_init() [function.curl-init]: Could not initialize a new cURL 
> handle in /Library/WebServer/Documents/lib/global/simplepie.php on line 7327"
> 
> ... followed by a host of other similar errors like this one:
> 
> "Warning:  curl_init() [function.curl-init]: Could not initialize a new cURL 
> handle in /Library/WebServer/Documents/lib/global/simplepie.php on line 7327"
> 
> (NOTE: The line numbers above are for 1.3-dev, but I get the same errors with 
> 1.2.)
> 
> Eventually the script, a loop through the large list of feeds, quits.
> 
> I'm certain the problem is not due to a particular feed -- I've tried the 
> script many times starting at different URL's within the long list, and every 
> time, after about 30-300 feeds are processed, I get these errors. It doesn't 
> stop at any particular URL.
> 
> Until recently, I was running PHP 5.2 and memory errors immediately followed 
> the curl-init errors listed above. After I switched to 5.3, the memory error 
> no longer shows up, but it still dies.
> 
> After doing some research, I came across the following:
> 
> http://bugs.php.net/45161
> 
> Bug #45161    Reusing a curl handle leaks memory
> 
> This bug was supposedly fixed though on 2008-12-17.
> 
> Any ideas?
>


Reply via email to