Support Forums
Memory leak - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: PHP The Hypertext Preprocessor (https://www.supportforums.net/forumdisplay.php?fid=21)
+---- Thread: Memory leak (/showthread.php?tid=18526)



Memory leak - hrs - 05-05-2011

When I run a PHP script, the script gets killed , when I check the
memory using the command TOP, this process is taking lot of memory
eventually running out..!!
when i check for memory in the script using memory_get_usage or
memory_get_peak_usage functions its uses around 2mb..!! the script
takes a datalist file, reads each row and executes mysql queries..!!
wat could be the reason..!!??
Thanks


RE: Memory leak - Gaijin - 05-05-2011

This just sounds as your loop is obviously way too big.
I have a Function which converts Strings of any length to HEX, since the function runs a loop through the string checking each character and converting it, the function uses over 2 MB for smallest texts.

Either try to find an another way to execute that much SQL commands or reduce them.
You could also use Ajax to execute the commands in smaller packs.. Big Grin
Posting the code could show some errors.... ;)