Re: pear::HTTP_Request and pear::Net_Socket

From: Date: Tue, 18 Apr 2006 03:57:31 +0000
Subject: Re: pear::HTTP_Request and pear::Net_Socket
References: 1 2 3  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23694@lists.php.net to get a copy of this message
On 4/17/06, Ryan Escarez <ryan.escarez@gmail.com> wrote: > On 4/18/06, Justin Patrin <papercrane@gmail.com> wrote: > > On 4/17/06, Ryan Escarez <ryan.escarez@gmail.com> wrote: > > > Hi, > > > > > > I'm using pear::HTTP_Request and I'm having difficulty gaining memory > > > that already used by pear::Net_Socket. I got the following error after > > > running my script > > > > > > <b>Fatal error</b>: Allowed memory size of 8388608 bytes exhausted > > > (tried to allocate 4097 bytes) in > > > <b>/usr/share/pear/Net/Socket.php</b> on line > > > <b>243</b><br /> > > > Allowed memory size of 8388608 bytes exhausted (tried to allocate 0 bytes) > > > > > > Is it possible to free up memory that already used by > > > pear::Net_Socket? I've tried checking on how many memory it consumed > > > and i found out that after doing a 20,000 pear::HTTP_Request loop, it > > > eats almost 8MB of RAM on 50% or 10,000 pear::HTTP_Request loop only > > > and the script stop. AFAIK increasing 8MB memory limit is not > > > advisable. Any idea or workaround on this? > > > > > > > I suggest trying to figure out where the memory leak is. Perhaps you > > should try unsetting your variables and see if that helps any. As a > > workaround you could always do less requests per script run. > > > > -- > > Justin Patrin > > > > > Hi Justin! > > Thanks for your suggestion, I already did unset() and > mysql_free_result() but neither of them had free up the already used > memory. Do you think this is a bug on pear::Net_Socket? > It could be. It could also be that the socket library in PHP has a memory leak. Perhaps try a different/newer version of PHP? -- Justin Patrin

« previous php.pear.general (#23694) next »