On Tue, Aug 19, 2008 at 11:07:40PM +0200, sophana wrote:
> I need to iterate over all the rows to check something.
> When doing this, I saw memory consumption raising infinitely.
> Then I remembered that sqlobjects caches everything.
> Then I tried:
> 
> for a in SOClass.select():
>   connection.cache.clear()
> 
> memory is still growing.
> Is it a python problem or a SQLObject problem?
> What do you suggest for this?

   .select() (SelectResult.__iter__, actually) draws all rows into one huge
list. Try

for a in SOClass.select().lazyIter():
   ...

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to