sqlalchemy.orm.session.close_all_sessions()--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/26f16790-685c-42aa-9c36-27970c838ffe%40googlegroups.com.
Hi,When you go through the objects, do you remove them from the session with session.expire(obj)?Hope this helps,João
On Wed, 26 Feb 2020 at 17:09, Ahmed Cheikh <hajer.ch...@gmail.com> wrote:
Hello Everybody,--I used SQLAlchemy in one of my projects. And in this project, I loop over many objects. I use for each object the same engine and session object to query from my database. What I noticed is that for each loop, there is an increase in the memory usage.I checked all the other reasons that could potientially lead to a memory leak and thee was none. So I was wondering if any of you faced such a problem? And if so did you find any solutionPS: I tried closing all my sessions after each iteration, delete session object and then garbage collect it, dispose engine and even used the recently addedsqlalchemy.orm.session.close_all_sessions()Thx for your help.
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlal...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/18f34cfb-9d80-4747-9e4c-7e538f813344%40googlegroups.com.