Welcome Guest, Not a member yet? Register   Sign In
how can I free the memory used by $this->db->insert()
#11

[eluser]pgee70[/eluser]
[quote author="BrianDHall" date="1262342383"]Try this before getting into your insert() logic:

Code:
$this->db->save_queries = false;

$this->db->queries and $this->db->query_times gets built up by default in CI unless you say so otherwise.

There is no need to use free_result() as that isn't the problem - its just that CI is saving all queries, which if you are running a LOT of queries (or just multiple queries with lots of data) you will of course run into memory problems.[/quote]

thanks. that is awesome. i was parsing three 300mb text files into a database, and couldn't work out where the problem was that was generating the out of memory errors.
i had tried loads of things, like sending a batch of 1000 rows at a time to the dbms to improve efficiency etc., unset all variables in the loop etc.
now the httpd is using 11mb, and everything is shiny ;-)




Theme © iAndrew 2016 - Forum software by © MyBB