On Jan 17, 2008 4:04 PM, Gary Poster <[EMAIL PROTECTED]> wrote:

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


I am still using that code, but I have just tested with iteritems() and the
memory usage is still  roughly the same.

If I remember correctly from the documentation, the method items on BTree
objects is not like items on dictionaries, it behaves like an iterator.

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


Guess I  have to call...  Ghostbusters!! lol (sorry couldn't resist the
joke!)


thanks,

flávio

>
>
> Gary
>
>
>


-- 
Flávio Codeço Coelho
----------------------------------------------------------------
"My grandfather once told me that there were two kinds of people: those who
do the work and those who take the credit. He told me to try to be in the
first group; there was much less competition."
Indira Gandhi
====================================
registered Linux user # 386432
get counted at http://counter.li.org
----------------------------------------------------------------
_______________________________________________
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