I am using django 1.3 and i am running a script outside of a web context using supervisor.
The memory usage of the process is growing every minute
The code look more or less like this :
while(1):
for auction in auction_list:
auction.update_auction()
db.reset_queries()
db.close_connection()
sleep(1)
Adding close_connection helped me out by avoiding LOCKS on the table but now i have this growing process problem.
How could i manage things to avoid this ?
I found a solution. The close_connection() was responsible for the growing memory. It seems that it cames from the connection/disconnection from the database.
I proceeded this way:
With commit_unless_managed() the daemon keeps the connection open and doesn’t grow in memory without locking completely the MyISAM table.