Memory leak in pyodbc.connect: version: 3.0.7

133 views
Skip to first unread message

shruti.k...@gmail.com

unread,
Jun 17, 2016, 5:32:19 AM6/17/16
to pyodbc


Hi,


I am using pyodbc to connect to sql server. In my scenario the login fails and pyodbc reports a Programming error. But in this case it does not release the memory after reporting the error.

Code:

import pyodbc, time
def testmem():
    conn = None
    try:
        conn = pyodbc.connect(conn_str)
    except Exception as e:
        pass
for i in range(100):
    testmem()

If I attach a profiler, I can see memory getting increased. Any idea how the memory can be freed in this case

Michael Kleehammer

unread,
Jan 19, 2017, 5:55:15 PM1/19/17
to pyodbc
I'll have to check.  In the meantime, can you test with version 4.0.2?

Michael Kleehammer

unread,
Jan 19, 2017, 5:55:53 PM1/19/17
to pyodbc
Also, it would be best to open an GitHub issue for things like this to get them noticed sooner.  Thanks.
Reply all
Reply to author
Forward
0 new messages