You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
github-actionsbot
changed the title
Memory leak after interrupting a SELECT query mid-way while it's fetching data
SNOW-1044042: Memory leak after interrupting a SELECT query mid-way while it's fetching data
Feb 6, 2024
I believe the huge memory consumption is because of the program is trying to fetching all the data at one time -- fetchall().
when this method is called, underneath the connector will download all the data first, appending the data to an internal list, and return until all the data has been downloaded, leading to the memory consumption accumulated internally.
to retrieve such huge amount of data, I would recommend you to go fetch chunk by chunk:
Unfortunately I cannot change the code to batching because I am using pandas' read_sql_query with the snowflake connector, which is most likely implemented via fetchall().
Is there any way to make sure the internal list you mention is garbage-collectable after an interrupt? Thank you
Python version
3.10.12
Operating system and processor architecture
Linux-6.1.58+-x86_64-with-glibc2.35
Installed packages
What did you do?
What did you expect to see?
I expected the RAM usage to go back down to the level where it was before running the SQL query.
Can you set logging to DEBUG and collect the logs?
The text was updated successfully, but these errors were encountered: