durusmail: durus-users: building a large BTree efficiently
building a large BTree efficiently
2005-10-14
2005-10-14
2005-10-14
2005-10-17
2005-10-17
2005-10-17
2005-10-17
2005-10-17
2005-10-19
2005-10-20
2005-10-20
2005-10-20
2005-10-20
2005-10-20
2005-10-26
2005-10-26
2005-10-26
building a large BTree efficiently
David Binger
2005-10-20
On Oct 20, 2005, at 3:54 PM, mario ruggier wrote:

>
> On Oct 20, 2005, at 5:07 PM, David Binger wrote:
>
>> On Oct 20, 2005, at 10:51 AM, mario ruggier wrote:
>>
>>
>>> Can this be made safer by simply checking if the objects's
>>> _p_status==SAVED, and if so then I can freely GHOST the object ?
>>>
>>
>> I think so.  I would use the _p_is_saved() instead of checking
>> _p_status directly.
>>
>
> I have added this to the processing of each item in the loop:
>
>             if item._p_is_saved():
>                 item._p_set_status_ghost()
>
> But, even with this, the "size" in the shrink_cache()'s  (len
> (cache.objects)) grows as fast as the total number of items
> processed, as previously reported.

Ghosting objects does not remove them from the cache.
It does, however, reduce the memory required to hold them
in memory.  A ghost object's __dict__ is empty.


reply