[ZODB-Dev] memory exhaustion problem

Flavio Coelho fccoelho at gmail.com
Thu Jan 17 11:37:17 EST 2008


This is my loop by the way:

    #initialization stuff here
    count = 0
    for k,u in user_root['userdb'].items():
        ui=User(userid=u.userid.values()[0])
        if 'delicious' in u.userid:
            de.users.append(ui)
        elif 'digg' in u.userid:
            di.users.append(ui)
        count += 1
        if count%1000 ==0:
            session.flush()
            print "%d flushed!"%count
            session.close()
            transaction.savepoint(True)

On Jan 17, 2008 2:32 PM, Flavio Coelho <fccoelho at gmail.com> wrote:

>
>
> On Jan 17, 2008 1:31 PM, Lennart Regebro <regebro at gmail.com> wrote:
>
> > On Jan 17, 2008 4:07 PM, Flavio Coelho <fccoelho at gmail.com> wrote:
> > > Am I doing something wrong, or is it impossible to iterate over a ZODB
> > > database which is bigger than you memory?
> >
> > Hmm. Are you sure you aren't modifying the ZODB objects when you do
> > this? That would have this effect.
>
>
> No, I am not modifying the objects in any way....
>
> Flávio
>
> >
> >
> > --
> > Lennart Regebro: Zope and Plone consulting.
> > http://www.colliberty.com/
> > +33 661 58 14 64
> >
>
>
>
> --
> 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
> ----------------------------------------------------------------
>



-- 
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/fe75fc73/attachment.htm


More information about the ZODB-Dev mailing list