Replies: 4 comments 7 replies
-
|
In You use SQLAlchemy. Can you make a stand-alone script showing the memory footprint instead? |
Beta Was this translation helpful? Give feedback.
-
|
Here is a standalone script: test.py My conclusion is that psycopg3 doesn't like variable |
Beta Was this translation helpful? Give feedback.
-
|
Note: discussion in SQLAlchemy at sqlalchemy/sqlalchemy#10270 |
Beta Was this translation helpful? Give feedback.
-
|
FYI, a fix for this issue was released in psycopg 3.1.11, where too large queries or queries with a large number of parameters are not cached. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I have the following sqlalchemy code.
I have not translated it to psycopg, but here is the idea: it uses a lot more RAM with psycopg v3 than v2, and memory usage tends to increase over time (yet it hits a fixed limit).
I suspect that there is a cache on select queries, that fills memory.
Memory evolution over time:

Here is a tracemalloc data:
Do you think something could be done to avoid such an overhead?
Beta Was this translation helpful? Give feedback.
All reactions