fromlst123 / pyodbc

Automatically exported from code.google.com/p/pyodbc
MIT No Attribution
0 stars 0 forks source link

Memory leak when committing after a select on MySQL ODBC 5.2 #306

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

See 
http://stackoverflow.com/questions/14126452/pyodbc-memory-leak-when-committing-a
fter-select-statement

What is the expected output? What do you see instead?

No memory leak, instead that script will rapidly grow in memory usage until the 
OOM killer kills it off.

What version of the product are you using? On what operating system?

Only seems to happen with the MySQL ODBC connector 5.2 (the current version) on 
Windows and Linux.

Original issue reported on code.google.com by p...@pdouglas.net on 22 Jan 2013 at 9:08

GoogleCodeExporter commented 9 years ago

Original comment by mkleehammer on 28 Mar 2013 at 10:28

GoogleCodeExporter commented 9 years ago
Confirmed. Happens on Microsoft Server 2012 with SQL Server ODBC Driver 11. The 
memory usage grows without bounds. Tracked it down with the new `tracemalloc` 
module to the lines where `cursor.execute()` is called. It does not happen on 
linux, and it was not tested with a MySQL ODBC driver. Lastly, using the 
`pypyodbc` module *does* work as expected with no permanent memory growth.

Original comment by ykuz...@gmail.com on 2 Jan 2014 at 8:16

GoogleCodeExporter commented 9 years ago
Sorry - didn't read the stackoverflow immediately. Just noticed this was the 
closest open issue to mine. (There was an open issue that was closer but it was 
closed back in 2011, so I figured this would be more appropriate.)

But removing `cursor.commit()` had no effect, and it *does* leak memory on 
inserts as well.

Original comment by ykuz...@gmail.com on 2 Jan 2014 at 8:22