MySQLdb - cursor - memory leak?
问题 I'm using MySQLdb under Python32 on Windows 7: Python 3.2.3 (default, Apr 11 2012, 07:12:16) [MSC v.1500 64 bit (AMD64)] on win32 >>> import MySQLdb as My >>> My.version_info (1, 2, 3, 'final', 0) I'm running service which calls this many times over and over and over again: cursor = self._connection._conn.cursor() cursor.execute(sql) for i in cursor.fetchall(): pass # Operation that is not important cursor.close() gc.collect() return set() # Will be filled with DB data And memory usage just