Hi,
I am using:
MySQL: 3.23.35
MySQLdb: 0.3.5
Python: 2.0 / 2.1
When I execute a query that returns a really big resultset(About 2MB) then (so I belive) MySQLdb uses a lot of memory. If I execute a much smaller query (some bytes) the memory is not freed even with extensive use of close() and del on the connection and the cursor. I think I tried all combinations of del and close().
Thanks in andvance
Christian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
0.3.5 and earlier versions have a reference count cycle related to the connection object. This is fixed in CVS. This may or may not fix your problem. The default Cursor class stores the entire result set on the client side. If your result set is big, you will use a lot of memory. An alternate solution is to use SSCursor, i.e. create the connection with the cursorclass=MySQLdb.SSCursor parameter. This fetches row by row (result set stored in the server). Note that you can have only one open cursor at a time with this class.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am using:
MySQL: 3.23.35
MySQLdb: 0.3.5
Python: 2.0 / 2.1
When I execute a query that returns a really big resultset(About 2MB) then (so I belive) MySQLdb uses a lot of memory. If I execute a much smaller query (some bytes) the memory is not freed even with extensive use of close() and del on the connection and the cursor. I think I tried all combinations of del and close().
Thanks in andvance
Christian
0.3.5 and earlier versions have a reference count cycle related to the connection object. This is fixed in CVS. This may or may not fix your problem. The default Cursor class stores the entire result set on the client side. If your result set is big, you will use a lot of memory. An alternate solution is to use SSCursor, i.e. create the connection with the cursorclass=MySQLdb.SSCursor parameter. This fetches row by row (result set stored in the server). Note that you can have only one open cursor at a time with this class.