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'ed?

On Dec 6, 2007 8:42 PM, Michael Bayer <[EMAIL PROTECTED]> wrote:

>
> 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 marked as "dirty" will also
> fall out of scope if you remove external references to them, before
> they are flushed.
>
> documentation is here:
> http://www.sqlalchemy.org/docs/03/unitofwork.html#unitofwork_identitymap
>
>
> 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_attributes
>
>
> On Dec 6, 2007, at 8:22 AM, Arun Kumar PG 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 monitor I see that
> > after every request to the application the memory consumption is
> > increasing and the memory is not getting returned back to the pool.
> > So if the memory consumption is 80 MB initially and after a request
> > comes and we do a whole bunch of SA processing then if I look at the
> > memory it will be let's say 82 MB and will stay there forever and it
> > keeps on going up and up with many requests coming in. And after a
> > while when it reaches 200 MB the application fails and no more
> > memory is available.
> >
> > Does that means that objects retrieved are cached forever without
> > any timeout? How can I alleviate this problem as this is very high
> > priority right now and needs to be fixed immediately.
> >
> > thoughts/suggestions/solutions all welcome.
> >
> > Thanks all!
> >
> > --
> > Cheers,
> >
> > - A
> > >
>
>
> >
>


-- 
Cheers,

- A

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to