I'm using MySQLdb 1.2.2, but I can repro the memory leak with today's trunk. Hence, I'm pretty sure this isn't repro-specific.
mysql Ver 14.12 Distrib 5.0.51, for apple-darwin9.2.1 (i686) using EditLine wrapper
Python 2.5.2
I'm using MacPorts on OS X 10.5, but I can repro this on Linux.
Darwin Macintosh-4.local 9.4.0 Darwin Kernel Version 9.4.0: Mon Jun 9 19:30:53 PDT 2008; root:xnu-1228.5.20~1/RELEASE_I386 i386
#####################################################
# This program leaks memory rather quickly. Removing the charset
# parameter fixes it.
import MySQLdb
import sys
while True:
connection = MySQLdb.connect(
user='user', passwd='password',
host='localhost', db='development',
charset='utf8')
try:
cursor = connection.cursor()
cursor.execute(
'select * from atoms where false')
sys.stdout.write('.')
sys.stdout.flush()
finally:
connection.close()
Kyle VanderBeek
MySQLdb
MySQLdb-1.2
Public
|
Date: 2009-03-18 11:57:08 PDT This Tracker item was closed automatically by the system. It was |
|
Date: 2009-02-27 16:34:44 PST Hrm, thought I marked this pending for 1.2.3b2... |
|
Date: 2009-02-25 01:03:38 PST I tried it out on 1.2br. It builds under MacPorts, which is awesome. |
|
Date: 2009-02-23 19:15:13 PST Ok, the patch is applied to both 1.2br and trunk. Will mark closed once |
|
Date: 2009-02-23 15:15:38 PST JJ - the attached patch should fix the "holy crap it leaks like a sieve" |
|
Date: 2009-02-18 11:08:37 PST I now have a working repro! I have some leads on the leak, but nothing |
|
Date: 2009-02-17 16:07:32 PST Sure: |
|
Date: 2009-02-17 11:09:14 PST jj, can you give me the complete CREATE TABLE for the "atoms" table |
|
Date: 2009-02-16 22:43:50 PST I tried out MySQL-python-1.2.3b1 on Ubuntu 8.04 with Python 2.5. It still |
|
Date: 2009-02-16 20:14:15 PST Ugh, trying to build MySQLdb on MacPorts is *hard*. I'm going to have a |
|
Date: 2009-02-16 19:32:32 PST > jj, are you still seeing this? I can't repro it. I've tried on trunk |
|
Date: 2009-02-16 19:30:08 PST > charset='utf8', use_unicode=False |
|
Date: 2009-02-04 16:47:32 PST jj, are you still seeing this? I can't repro it. I've tried on trunk and |
|
Date: 2009-01-09 01:52:32 PST > # This program leaks memory rather quickly. Removing the charset |
|
Date: 2009-01-08 17:55:18 PST Any idea what the change was in trunk that fixed this? |
|
Date: 2008-09-26 16:40:04 PDT Sorry, I'm going to reopen this; I was the one who originally closed it. |
|
Date: 2008-09-23 15:13:45 PDT Duh, it looks like this has already been fixed in trunk. I was running it |
|
Date: 2008-09-23 14:35:40 PDT File Added: mysqlleak.py |
| Filename | Description | Download |
|---|---|---|
| mysqlleak.py | This is a short script that causes a memory leak. Just run it and monitor top. | Download |
| MySQLdb-1_2-unicode-leak.diff | Fix several potential leaks during converter iteration. | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Pending | 2009-03-18 11:57:08 PDT | sf-robot |
| allow_comments | 1 | 2009-03-18 11:57:08 PDT | sf-robot |
| close_date | 2009-02-27 16:34 | 2009-03-18 11:57:08 PDT | sf-robot |
| close_date | - | 2009-02-27 16:34:45 PST | kylev |
| status_id | Open | 2009-02-27 16:34:45 PST | kylev |
| close_date | 2009-02-23 19:15 | 2009-02-25 01:03:38 PST | jjinux |
| status_id | Pending | 2009-02-25 01:03:38 PST | jjinux |
| assigned_to | adustman | 2009-02-23 19:15:13 PST | kylev |
| status_id | Open | 2009-02-23 19:15:13 PST | kylev |
| resolution_id | None | 2009-02-23 19:15:13 PST | kylev |
| close_date | - | 2009-02-23 19:15:13 PST | kylev |
| File Added | 314869: MySQLdb-1_2-unicode-leak.diff | 2009-02-23 15:14:24 PST | kylev |
| close_date | 2008-09-23 15:13 | 2008-09-26 16:40:04 PDT | jjinux |
| resolution_id | Invalid | 2008-09-26 16:40:04 PDT | jjinux |
| status_id | Closed | 2008-09-26 16:40:04 PDT | jjinux |
| close_date | - | 2008-09-23 15:13:45 PDT | jjinux |
| resolution_id | None | 2008-09-23 15:13:45 PDT | jjinux |
| status_id | Open | 2008-09-23 15:13:45 PDT | jjinux |
| File Added | 294616: mysqlleak.py | 2008-09-23 14:35:40 PDT | jjinux |