iterating many rows consumes a LOT of memory |
I've got utility scripts I use to tidy up my data before deploying it to my production site. One script in particular has to fetch a lot of records and iterate them all (NOTE: I have *tried* to refactor this code to work some other way but cannot find another way to do it without iterating all the records). This is causing CodeIgniter to chew up a LOT of memory and I'm getting an 'out of memory' error. Seems to me like CI's mysqli driver might have a memory leak? Is there something I can do to improve memory management for a script? Here's an example script:
PHP Code: public function example() { Code: 90121 rows found Am I missing something? Note that I set $this->db->save_queries to FALSE and I'm using $query->unbuffered_row() and I still have this problem. I have been searching and I see a post from four years ago which IMHO was prematurely closed. My CI version is 3.0.7-dev downloaded from github today. |
Messages In This Thread |
iterating many rows consumes a LOT of memory - by sneakyimp - 05-27-2016, 02:25 PM
RE: iterating many rows consumes a LOT of memory - by cartalot - 05-28-2016, 12:46 PM
RE: iterating many rows consumes a LOT of memory - by John_Betong - 05-28-2016, 05:06 PM
|