<br><br><div class="gmail_quote">On Jan 17, 2008 4:04 PM, Gary Poster <<a href="mailto:gary@zope.com">gary@zope.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>On Jan 17, 2008, at 11:57 AM, Flavio Coelho wrote:<br><br>> Some progress!<br>><br>> Apparently the combination of:<br>> u._p_deactivate()<br>> transaction.savepoint
(True)<br>> transaction.commit()<br>><br>> helped. Memory consumption keeps growing but much more slowly<br>> (about 1/5 of the original speed). Please correct me if I am wrong,<br>> but I believe that ideally memory usage should stay constant
<br>> throughout the loop, shouldn't it?<br><br></div>Are you still using the example code you gave in a previous message?<br>If so, you are generating and storing user objects in a list, which<br>grows. If not, maybe give a snippet of your current example code.
</blockquote><div><br>I am still using that code, but I have just tested with iteritems() and the memory usage is still roughly the same.<br><br>If I remember correctly from the documentation, the method items on BTree objects is not like items on dictionaries, it behaves like an iterator.
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><div class="Ih2E3d"><br>> Moreover, I shouldn't need to commit either, since I am not
<br>> modifying the objects...<br><br></div>You need to tell the ZODB about the transaction boundary so it knows<br>when to "let go". transaction.abort() would work too. You could also<br>manually much with the persistent object cache I suppose, though
<br>_p_deactivate should be doing most of what would help...<br>"ghosts" (deactivated objects) still take up some memory.</blockquote><div><br>Guess I have to call... Ghostbusters!! lol (sorry couldn't resist the joke!)
<br><br><br>thanks,<br><br>flávio<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><font color="#888888"><br>Gary<br><br><br></font>
</blockquote></div><br><br clear="all"><br>-- <br>Flávio Codeço Coelho<br>----------------------------------------------------------------<br>"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."
<br>Indira Gandhi<br>====================================<br>registered Linux user # 386432<br>get counted at <a href="http://counter.li.org">http://counter.li.org</a><br>----------------------------------------------------------------