Re: Still need help with some kind of memory leak in my php database program. General hints for php would help
| From: | Chris | Date: | Mon, 26 May 2008 01:04:17 +0000 |
| Subject: | Re: Still need help with some kind of memory leak in my php database program. General hints for php would help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-274679@lists.php.net to get a copy of this message | ||
> // IF I RUN THIS THROUGH A LOOP:
> // for($j=0;$j<20, $j++){ $many_selected[$jj] = fu_bar($pg,
> $BIG_SELECT_cmd)} THE TEST PROGRAM CRASHES so I think I have
> more copies of the result of this query than I need.
This is just going to create a multi-dimensional array - with each
element being one result set - so yes that's going to take a lot of memory.
To debug your memory issue, see some ideas here:
http://www.davedevelopment.co.uk/2008/05/12/log-memory-usage-using-declare-and-ticks-in-php/
but instead of keeping a global variable (or session variable), log it
to a file instead:
http://www.davedevelopment.co.uk/2008/05/12/log-memory-usage-using-declare-and-ticks-in-php/#comment-52074
--
Postgresql & php tutorials
http://www.designmagick.com/