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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.