[CONPY-263] Memory leak if cursor.close() not called explicitly Created: 2023-05-08 Updated: 2023-05-08 |
|
| Status: | Open |
| Project: | MariaDB Connector/Python |
| Component/s: | Generic |
| Affects Version/s: | 1.1.6 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | G.Mech | Assignee: | Georg Richter |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | None | ||
| Environment: |
WIN10 and debian 11 bullseye |
||
| Attachments: |
|
| Python Version: | 3.10.4 |
| Description |
|
I consider this to be bug. If you think otherwise, please treat it as a feature request or update documentation. Steps to reproduce
Expected outcomeMemory is freed when Cursor objects get garbage collected. The documentation does not tell, that cursor.close() must be called in order to avoid memory leaks. Also PEP-249 suggests, that calling cursor.close() is optional and that the garbage collector will eventually clean up resources:
Actual outcomeOutput of attached script:
WorkaroundCall cursor.close() explicitly after using a cursor. |