Possible memory leak when using rowfactory
robingie opened this issue · 10 comments
-
OracleDB version
Oracle 11.2.1 -
Commands
- print("sys.maxsize > 232:", sys.maxsize > 232)
True - print("platform.platform:", platform.platform())
platform.platform: Linux-4.18.0-348.7.1.el8_5.x86_64-x86_64-with-glibc2.28 - print("platform.python_version:", platform.python_version())
platform.python_version: 3.9.6 - print("cx_Oracle.version:", cx_Oracle.version)
cx_Oracle.version: 8.3.0 - print("cx_Oracle.clientversion:", cx_Oracle.clientversion())
cx_Oracle.clientversion: (19, 6, 0, 0, 0)
-
Is it an error or a hang or a crash?
Hang because the system can run out of memory. -
What error(s) or behavior you are seeing?
The Python application grows in memory size after a while. Each time a new cursor is created and the cursor.rowfactory is used, the memory requirement increases. -
Include a runnable Python script that shows the problem.
with conn.cursor() as cur:
cur.execute(query2, start_id=start_id)
# This line causes a growing memory footprint
cur.rowfactory = lambda *args: dict(zip([d[0] for d in cur.description], args))
# This line avoids the memory leak
data = [dict((cur.description[i][0], value) for i, value in enumerate(row)) for row in cur.fetchall()]I too have been having the same issue when running this. I have experienced black-screen as well as blue-screen because of the growing memory size.
What's the progress on this?
@lime-n Please upgrade cx_Oracle to the new version, now called python-oracledb, see the release announcement and run your test case.
If this issue still persists, please provide us a runnable test case with the complete platform details as shown in the initial comment of this bug.
Hi @sharadraju,
I have been using python-oracledb and this issue will regardlessly persist. When I have some time, I'll upload a reproducible example.
This issue has been automatically marked as inactive because it has not been updated recently. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not been updated for a month.
