Jump to content

Tracking down Memory Consumption Issue


rtheta

Recommended Posts

Hi, I am running out of memory using a php script, but can't seem to determine what is eating the memory.  I set the php ini to a ridiculous amount, but still get:

 

[Wed Mar 14 10:46:45 2007] [error] [client 192.168.69.100] PHP Fatal error:  Allowed memory size of 402653184 bytes exhausted (tried to allocate 2883495 bytes) in Unknown on line 0, referer: http://192.168.69.139/testing.php

 

I tried using the following function to determine the amount of memory usage:

function memory_log($str)
{
        debug_log("MEMORY " . round(memory_get_usage()/1024, 0) . "k - $str");
}

 

And make the call before and after, and during the function that APPEARS to be where the memory error occurs.  When I do so, it only reports using 30 MB of memory, not 300+.  Obviously running out on line zero hasn't helped a lot, and the function in question doesn't seem like it should be a big memory hog.  I am using php 5.2.0, and mysql 5.0.26.  What is the best way to diagnose an issue like this?  Thank you so much!

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/42698-tracking-down-memory-consumption-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.