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
https://forums.phpfreaks.com/topic/84618-memory-leak-tracking/#findComment-431150
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
https://forums.phpfreaks.com/topic/84618-memory-leak-tracking/#findComment-431168
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.