On Jan 17, 2008, at 11:57 AM, Flavio Coelho wrote:

Some progress!

Apparently the combination of:
            u._p_deactivate()
            transaction.savepoint(True)
            transaction.commit()

helped. Memory consumption keeps growing but much more slowly (about 1/5 of the original speed). Please correct me if I am wrong, but I believe that ideally memory usage should stay constant throughout the loop, shouldn't it?

Are you still using the example code you gave in a previous message? If so, you are generating and storing user objects in a list, which grows. If not, maybe give a snippet of your current example code.

Moreover, I shouldn't need to commit either, since I am not modifying the objects...

You need to tell the ZODB about the transaction boundary so it knows when to "let go". transaction.abort() would work too. You could also manually much with the persistent object cache I suppose, though _p_deactivate should be doing most of what would help... "ghosts" (deactivated objects) still take up some memory.

Gary


_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to