Calling obj._p_deactivate() didn&#39;t help either....<br><br>I made a few simple tests:<br><br>if I run a empty loop (with just a pass statement), its fine. However If I something as simple as printing an attribute of the object, there goes my memory....
<br><br>thanks,<br><br>Flávio<br><br><div class="gmail_quote">On Jan 17, 2008 1:52 PM, Tres Seaver &lt;<a href="mailto:tseaver@palladion.com">tseaver@palladion.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;">
-----BEGIN PGP SIGNED MESSAGE-----<br>Hash: SHA1<br><div class="Ih2E3d"><br>Flavio Coelho wrote:<br>&gt; Hi,<br>&gt;<br>&gt; I wrote a simple script to move data from a ZODB database to sqlite.<br>&gt; &nbsp;My data is in a OOBTree, I chose this because supposedly you can bring the
<br>&gt; buckets to memory one at a time....<br>&gt;<br>&gt; So what I am doing is basically this: I iterate over my objects and write<br>&gt; them one-by-one to the other db.<br>&gt; for k,u in user_root[&#39;userdb&#39;].items(): # I have tried iteritems() here too
<br>&gt; but the results are the same....<br>&gt; &nbsp; &nbsp; # write the data to sqlite<br>&gt;<br>&gt; My problem is that my database is big and &nbsp;as the memory consumption<br>&gt; increases as the loop progresses until all my memory is exhauted and the OS
<br>&gt; goes into swap. It seems that the objects from previous iterations are not<br>&gt; been cleared from memory.<br>&gt; Am I doing something wrong, or is it impossible to iterate over a ZODB<br>&gt; database which is bigger than you memory?
<br><br></div>The connection normally only tries to enforce its cache size limit at<br>transaction boundaries: &nbsp;if you are iterating manually in a script, you<br>need to free things up manually, e.g. by calling &#39;_p_deactivate&#39; on the
<br>object when you are done with it.<br><br><br>Tres.<br>- --<br>===================================================================<br>Tres Seaver &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+1 540-429-0999 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:tseaver@palladion.com">
tseaver@palladion.com</a><br>Palladion Software &nbsp; &quot;Excellence by Design&quot; &nbsp; &nbsp;<a href="http://palladion.com" target="_blank">http://palladion.com</a><br>-----BEGIN PGP SIGNATURE-----<br>Version: GnuPG v1.4.6 (GNU/Linux)
<br>Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org" target="_blank">http://enigmail.mozdev.org</a><br><br>iD8DBQFHj3nK+gerLs4ltQ4RAtyIAKDYrXI9Zs8uJhagbudeJG36LdQvaACfe3VU<br>AHgNdjbyIUkRgUkjZsizJMw=
<br>=d42v<br>-----END PGP SIGNATURE-----<br></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>----------------------------------------------------------------