robdog Well-known member Jun 14, 2013 #1 I have PHP script that I run through CLI and it is using A LOT of memory. (but it is doing a ton of work) What techniques should I use to free up memory during the CLI processing?
I have PHP script that I run through CLI and it is using A LOT of memory. (but it is doing a ton of work) What techniques should I use to free up memory during the CLI processing?
robdog Well-known member Jun 15, 2013 #3 Shamil said: What does your script do? Click to expand... A ton of DB queries inside a foreach loop. I have tried using UNSET and the built in PHP garbage collection tags, but nothing really seems to be helping.
Shamil said: What does your script do? Click to expand... A ton of DB queries inside a foreach loop. I have tried using UNSET and the built in PHP garbage collection tags, but nothing really seems to be helping.
S Shamil Well-known member Jun 15, 2013 #4 I'm generally scared of things like this: PHP: foreach ($array as $key => $data){ $query = "UPDATE ..."; $db->query($query); } Have you profiled your script?
I'm generally scared of things like this: PHP: foreach ($array as $key => $data){ $query = "UPDATE ..."; $db->query($query); } Have you profiled your script?
digitalpoint Well-known member Jun 19, 2013 #5 Do you have XenForo's debug config option enabled? It stores a lot of info for each query run...