On Saturday, January 14, 2017 at 3:06:21 AM UTC-5, Nikunj Yadav wrote: > > But I am interested in knowing, assuming the dumbest setting that I could > have done is it possible that sqlalchemy is keeping a lot of references in > memory ? > > Perhaps I can think of a dumber mistake than Mike did...
It is possible that your implementation does not properly create and close/expire/dispose/etc Sessions and transactions as it should. In an *extremely unlikely variant( of this mistake, you might have a single Session that is started and every request uses it to read -- without ever being closed. In that scenario, the session's object map would keep growing. Most integration packages (ie flask-sqlalchemy) and tutorials actively guide you from doing this, so the chances of this happening are incredibly slim. Some best-practices of managing a session in web applications like Flask are detailed in these two sections of the documentation: * http://docs.sqlalchemy.org/en/latest/orm/session_basics.html#session-frequently-asked-questions * http://docs.sqlalchemy.org/en/latest/orm/contextual.html -- 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+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.