Jump to content

memory leak tracking


delphi123

Recommended Posts

and what exactly is your host referring to? If they mean you're using too much memory, try to consolidate your code. Make it more efficient. There's no real way of knowing what the problem is without a bit more info.

 

Sorry.

 

However a hint might be to start looking at SQL queries... Are you grabbing a million files or so, then using mysql_num_rows() or are you counting in the SQL Query using SELECT COUNT(*) as records?

 

The first is bloated and takes a LOT more effort than the second. This might be what they're on about...

 

Hope this helps.

Link to comment
Share on other sites

thanks for the reply - they were saying that there was a while statement that caused it:

 

'The reason your while loop does not work is because you do not define the $column_counter variable before using it, nor do you increase it at all in the loop. So, the loop just continues to run until it eventually uses all the memory on the server.'

 

I didn't realise you needed to increment while statements?!  most tutorials seem to just say things like:

 

while ($table = mysql_fetch_array($result)){

//do code

}

 

am I wrong?

 

Also how can I check how much memory is being used?  I'm running the code on localhost and I was wondering if there's any software that'll tell you what load the server is under etc?

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.