[ZODB-Dev] experimenting with Standalone ZODB...

Casey Duncan c.duncan@nlada.org
Fri, 19 Oct 2001 10:56:38 -0400


On Friday 19 October 2001 10:46 am, enrico.sirola@riskmap.net allegedly wrote:
> >>>>> "Casey" == Casey Duncan <c.duncan@nlada.org> writes:
>
>     Casey> AFAIK: a persistentMapping (like a dict) is a monolithic
>     Casey> object. It therefore is loaded all at once (all keys and
>     Casey> values) when it is accessed. That is likely using up all of
>     Casey> the memory of your machine.
>
>     Casey> You should use a BTree as your products object if you want
>     Casey> it to be able to load and unload individual elements from
>     Casey> memory.
>
>     Casey> I think on IOBTree (Integer to object mapping) might work
>     Casey> in your case.
>
> While digging the list's past threads I saw there was a huge thread on
> the caching subject some time ago
> It seems that the problem is related with garbage collection. A call
> to <Connection instance>.cacheGC() after every history read seems
> to solve the problem, (I tried it even with ZOE + multithreading client and
> it works quite well - the cache reaches 40-45MB and remains around this
> value).
> Prolly an explicit call to cacheGC() isn't very
> elegant, but it works (I think this implies that one writes a
> wrapper class who do this dirty work and reuse this).
>
> Your advice about BTrees lead me in exploring the amazing world of
> Catalogs. I found this document:
>
> http://www.zope.org/Members/kelcmab3/catalog_out_of_zope
>
> which explains how to use them outside ZOPE, but it seems I can't
> import ZCatalog from a command line python2.1 interpreter (Zope 2.4.1
> here). Here's what's happening:
[snip]

You can't use ZCatalog outside of Zope (it is just a wrapper anyhow). Use 
plain Catalog instead.

/---------------------------------------------------\
  Casey Duncan, Sr. Web Developer
  National Legal Aid and Defender Association
  c.duncan@nlada.org
\---------------------------------------------------/