Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
0.9.56
-
None
Description
Wnen opening and closing a cursor in a loop, the size of used memory increases constantly.
How to repeat:
import mariadb |
import resource |
|
i=0 |
end=10000 |
i=0 |
connection= mariadb.connect(user="georg") |
last_used_mem= resource.getrusage(resource.RUSAGE_SELF).ru_maxrss |
|
while i < end: |
cursor=connection.cursor() |
cursor.close()
|
diff_mem= resource.getrusage(resource.RUSAGE_SELF).ru_maxrss - last_used_mem |
if diff_mem > 0: |
print("leak: %s" % diff_mem) |
last_used_mem+= diff_mem |
conn.close()
|