sqlalchemy memory usage

57 views
Skip to first unread message

lestat

unread,
Nov 23, 2011, 10:14:41 AM11/23/11
to sqlalchemy
if I do

for x in xrange(10000):
u = User.query.get(x)

that python process memory up to 70 mb, and after cycle I try do

db.session.close_all()

or

db.session.expire_all()

but process memory not clear and it still 70 mb.

If I working with millions of objects and try clearing memory, it use
all operating memory in system.

How I can solve this problem?

Thanks.

Michael Bayer

unread,
Nov 23, 2011, 10:16:21 AM11/23/11
to sqlal...@googlegroups.com
Python processes in CPython don't release memory back to the OS.

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

Reply all
Reply to author
Forward
0 new messages