[UPHPU] PHP memory leaks

Joseph Scott joseph at randomnetworks.com
Mon Sep 22 23:31:43 MDT 2008


On Sep 22, 2008, at 11:02 PM, Wade Preston Shearer wrote:

> I am getting memory leak notices in Apache's error log. Are these  
> leaks in the PHP engine or my script? If it's my script, how would I  
> debug that? It tells me the file that the leaks are occurring with  
> but that's all. Is there a way to get more verbose information?


Are these actual memory leak notices, or something that indicates that  
it's max'd out it's allowed memory usage?  Might be helpful to see one  
of the actual messages.

My guess would be that it's something along the lines of:

	PHP Fatal error: Out of memory (allocated 30408704) (tried to  
allocate 745813 bytes) in xxxxxxxxxxxx on line yyyyyyyyyyy

If that's the case then PHP is bumping up against it's allowed memory  
limit.  Slurping in large amounts of data (XML, DB, long running  
process) without freeing up any of the resources is often the  
culprit.  The other option is to increase the memory that PHP is  
allowed to allocate, but of course that only works up to a point :-)

--
Joseph Scott
joseph at randomnetworks.com
http://joseph.randomnetworks.com/






More information about the UPHPU mailing list