My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 223: memory leak in v2.1.11 when using charset utf8
1 person starred this issue and may be notified of changes. Back to list
Status:  Complete
Owner:  ----
Closed:  Dec 2011


 
Reported by roman.ba...@gmail.com, Nov 7, 2011
pyodbc v2.1.11
python 2.6.5 32-bit
windows 7

The following simple script leaks memory:

import pyodbc
import gc
import config

while True:
    gc.collect()
    conn = pyodbc.connect(config.connection_string, autocommit=True, charset="utf8")
    conn.close()
    
            
Without charset="utf8" it doesn't leak.

Dec 18, 2011
Project Member #1 mkleehammer
This seems to be fixed as of 3.0.2-beta02.  Can you retest with that version?

Version 3.0.1 crashes due to the charset keyword, so beta02 will be required.

Also, so we can test the same way, how were you measuring the leak?  I ran the loop 200,000 times and watched the Private Bytes.  They initially moved up but then hovered in the same area and actually came back down to the original size at ~20K loops.  Given there is the entire ODBC library plus the driver, some initial variability would be expected.

Status: Investigating
Dec 18, 2011
Project Member #2 mkleehammer
(No comment was entered for this change.)
Status: Complete
Feb 9, 2012
#3 larry.j....@gmail.com
I am seeing this leak even without the utf8.  Here is how I am monitoring memory while the above script is running in another window (Linux):

[nz@NZ80851-H1 scripts]$ while [ true ]; do ps aux --sort -rss | grep python | grep -v "grep" | head -n 6; sleep 5; done
nz        4149 53.6  0.2 171684 59000 pts/4    R+   08:29   0:01 python ./test.py
nz        4149 55.1  0.6 265704 152900 pts/4   S+   08:29   0:04 python ./test.py
nz        4149 55.5  1.0 360544 247804 pts/4   S+   08:29   0:07 python ./test.py
nz        4149 55.6  1.3 456800 344056 pts/4   R+   08:29   0:10 python ./test.py
nz        4149 55.8  1.7 553360 440656 pts/4   S+   08:29   0:12 python ./test.py
nz        4149 55.8  2.1 650544 537800 pts/4   S+   08:29   0:15 python ./test.py
nz        4149 55.9  2.5 743656 630972 pts/4   R+   08:29   0:18 python ./test.py
nz        4149 56.0  2.9 838016 725276 pts/4   S+   08:29   0:21 python ./test.py
nz        4149 56.1  3.3 932020 819276 pts/4   S+   08:29   0:24 python ./test.py
nz        4149 56.1  3.7 1027056 914312 pts/4  R+   08:29   0:26 python ./test.py
nz        4149 56.2  4.0 1123128 1010448 pts/4 S+   08:29   0:29 python ./test.py
nz        4149 56.2  4.4 1216160 1103544 pts/4 R+   08:29   0:32 python ./test.py
nz        4149 56.3  4.8 1308412 1195668 pts/4 R+   08:29   0:35 python ./test.py
nz        4149 56.3  5.2 1401420 1288740 pts/4 R+   08:29   0:38 python ./test.py

Feb 9, 2012
#4 larry.j....@gmail.com
I should also mention that I am not 3.0.2 yet, will try today.

Powered by Google Project Hosting