I’m doing lots (like millions) of active record inserts in a function. CI maintains the insert query after the insert is done, and the result is that I run out of memory before my function is complete. I dumped out $this after each insert, and I can see it growing each time with the insert info, so I’m fairly certain this is where the memory leak is.
If I was doing a query, I could free the memory after, like this:
$result = $this->db->query("INSERT blah");
$result->free_result();
However, the insert function doesn’t return the database object, instead it returns a TRUE/FALSE. So, doing this returns an error:
$result = $this->db->insert($blah);
$result->free_result();
How can I free the memory used by an active record insert?
Thanks!
