rtheta Posted March 14, 2007 Share Posted March 14, 2007 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.