[ZODB-Dev] Re: memory exhaustion problem

Flavio Coelho fccoelho at gmail.com
Thu Jan 17 13:54:46 EST 2008


On Jan 17, 2008 4:04 PM, Gary Poster <gary at zope.com> 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
----------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zodb-dev/attachments/20080117/86bcb7ef/attachment.htm


More information about the ZODB-Dev mailing list