[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-07 Thread King Simon-NFHD78
Felix Schwarz wrote: > > I have a question which I think is similar enough to be asked > in the same > thread: I have a set of quite simple migration scripts which > us SQLAlchemy 0.4 > and Elixir 0.4. I do extract data from the old legacy (MySQL) > database with > SQLAlchemy and put this da

[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-07 Thread Michael Bayer
On Dec 7, 2007, at 1:17 AM, Arun Kumar PG wrote: > I used weak ref dict and doing a session.clear() post every request. > But when I do a len(gc.get_objects()) post every request I can see > that the number of objects keeps on increasing. Do we have a > background thread that frees up the

[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-06 Thread Arun Kumar PG
I used weak ref dict and doing a session.clear() post every request. But when I do a len(gc.get_objects()) post every request I can see that the number of objects keeps on increasing. Do we have a background thread that frees up the unused objects in SA after a while? On Dec 7, 2007 3:49 AM, Micha

[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-06 Thread Michael Bayer
On Dec 6, 2007, at 4:58 PM, Felix Schwarz wrote: > > Michael Bayer schrieb: >> in version 0.4, the session is weak referencing so that objects >> which are not elsewhere referenced (and also are not marked as >> dirty or deleted) fall out of scope automatically. that is >> documented at

[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-06 Thread Felix Schwarz
Michael Bayer schrieb: in version 0.4, the session is weak referencing so that objects which are not elsewhere referenced (and also are not marked as dirty or deleted) fall out of scope automatically. that is documented at: > http://www.sqlalchemy.org/docs/04/session.html#unitofwork_using

[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-06 Thread Rick Morrison
If I recall, your application is using localthread strategy and scoped_session(), doesn't it? Doesn't scoped_session() collect references from otherwise transient Session()'s and hold on to them between calls? --~--~-~--~~~---~--~~ You received this message because

[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-06 Thread Arun Kumar PG
In my application i am creating a new session for each request and getting rid off the session (it goes out of scope) before sending the response back to the client. So does that means that the session object is still holds onto objects even though it goes out of scope and eligible for getting GC'e

[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-06 Thread Michael Bayer
the session in 0.3 holds onto objects until they are explicitly removed using session.clear() or session.expunge(). as a super quick fix you can use the "weak_identity_map" flag with the 0.3 session which will change the identity map to be weak referencing. however, objects which are marke

[sqlalchemy] Re: IMPORTANT: Does SA caches objects in memory forever?

2007-12-06 Thread Arun Kumar PG
FYI: I am using SA 0.3.9. On Dec 6, 2007 6:52 PM, Arun Kumar PG <[EMAIL PROTECTED]> wrote: > Hi All, > > I am having this problem with memory consumption when using SA. I have 200 > MB ram allocated for the application and when I look at the usage statistics > using top or any other memory monito