[ZODB-Dev] Re: Memory Errors reading large ZODB

Gary Poster gary at zope.com
Wed Aug 1 16:30:06 EDT 2007


On Aug 1, 2007, at 4:16 PM, Alan Runyan wrote:

> snip...
>
>> line 96, in
>> __setstate__
>>     Persistent.__setstate__(self, state)
>> MemoryError
>
> means you have run out of memory.  check your jail or how much memory
> you have allocated.
>
> you can call cache minimize after a threshold.. maybe every 100  
> iterations.

sounds good, assuming you know you are not writing.

If you think you might be writing but don't intend to, and are  
willing to be sloppy, you probably could use transaction.abort()  
instead.

If you were writing, the old trick was transaction.commit(1) and the  
new one is transaction.savepoint().

> there are finer grain mechanisms to do this but i cant remember them
> off the top of my head.
>
> http://svn.zope.org/ZODB/trunk/src/ZODB/interfaces.py

You are working with an old version of ZODB though, you said, so be  
careful looking at the trunk's interface-it might not describe  
precisely what you are using (savepoint is particularly pertinent here).

Gary



More information about the ZODB-Dev mailing list