<br><br><div class="gmail_quote">On Jan 17, 2008 4:04 PM, Gary Poster &lt;<a href="mailto:gary@zope.com">gary@zope.com</a>&gt; 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>&gt; Some progress!<br>&gt;<br>&gt; Apparently the combination of:<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; u._p_deactivate()<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; transaction.savepoint
(True)<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; transaction.commit()<br>&gt;<br>&gt; helped. Memory &nbsp;consumption keeps growing but much more slowly<br>&gt; (about 1/5 of the original speed). Please correct me if I am wrong,<br>&gt; but I believe that ideally memory usage should stay constant
<br>&gt; throughout the loop, shouldn&#39;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. &nbsp;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&nbsp; 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>&gt; Moreover, I shouldn&#39;t need to commit either, since I am not
<br>&gt; modifying the objects...<br><br></div>You need to tell the ZODB about the transaction boundary so it knows<br>when to &quot;let go&quot;. &nbsp;transaction.abort() would work too. &nbsp;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>&quot;ghosts&quot; (deactivated objects) still take up some memory.</blockquote><div><br>Guess I&nbsp; have to call...&nbsp; Ghostbusters!! lol (sorry couldn&#39;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>&quot;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.&quot;
<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>----------------------------------------------------------------