I am using cx_Oracle and MySQLdb to pull a lot of data from some tables and I find that the cursor.execute method uses a lot of memory that never gets garbage collected. Using fetchmany instead of fetchall does not seem to make any difference, since it's the execute that uses memory. Breaking the query down to build lots of small tables doesn't help, since execute doesn't give its memory back, after reading enough small tables execute returns a memory error. What is the trick to get memory back from execute in cx_Oracle and MySQLdb?
-- http://mail.python.org/mailman/listinfo/python-list