title: psycopg2 leaking memory after large query
body: <p>I'm running a large query in a python script against my postgres database using psycopg2 (I upgraded to version 2.5). After the query is finished, I close the cursor and connection, and even run gc, but the process still consumes a ton of memory (7.3gb to be exact). Am I missing a cleanup step?</p>
  
  <pre><code>import psycopg2
  conn = psycopg2.connect("dbname='dbname' user='user' host='host'")
  cursor = conn.cursor()
  cursor.execute("""large query""")
  rows = cursor.fetchall()
  del rows
  cursor.close()
  conn.close()
  import gc
  gc.collect()
  </code></pre>