Hi,

In  what way is sqlalchemy dependend on pythons cyclic gc?,
Is there any effort to make it work even if gc is off?.

I tried to turn gc off in a server side program i am developing, but
this resulted in
a lot of 'leaked' cycles/memory as soon as sqlalchemy is used to do
some queries...

I traced one cycle down to the relation between Session and
SessionTransaction. They both
hold a reference to each other, and this cycle is not broken in the
session's close method, nor is one
of them a weakref...

Turning on gc leak detection, also showes a lot of IdentyManagedState
objects being involved in cycles (e.g. not collected by refcount). The
number of these objects just keeps growing with each query. Closing
the Session has no influence on this...

Depending on cyclic gc is detrimental to the performance of server
side apps server serving many simultanious clients. The cyclic gc will
halt the whole python process for up to seconds (if there is a large
number of object instances in the process). All clients will thus
experience quite some lag when the cycle gc kicks in.

Unfortunatly with sqlalchemy tuning the gc to not run so often is also
not good, because of the very large numbers of instances being
created. A simple query for 2000 rows in my experience already creates
about 10mb worth of sqlalchemy objects involved in cycles that need to
be gc'd. So putting of the gc would mean memory would quickly be
exhausted....

(i am using sqlalchemy trunk revision 5200)

--~--~---------~--~----~------------~-------~--~----~
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