[Zope] Tip: huge memory leak fixed (dtml and pythonscript)

Jo Meder jo@meder.de
Fri, 2 Aug 2002 11:50:09 +0200


Hello everybody,

after much gnashing of teeth and pulling out of hair we finally seem to
have found the error in our ways. What we were doing led to a massive
memory leak and I thought I'd let everbody know so you know what to
avoid.

Our setup is something like <dtml-document or method> calls
<pythonscript> and <pythonscript> calls <restrictedTraverse> for some
given <path>. The resulting <object> is then used to render some content
and the resulting data is returned.

Here comes the warning: If you don't explicitly set the <object>
obtained by <restrictedTraverse> to <None> (maybe you could <del> it
instead just as well) this <object> will be leaked with any
<subobjects> instantiated along the way, namely a
<ImplicitAcquirerWrapper> and (in our case) a <DateTime>.


Hope this helps someone somewhere.

	Jo.


-- 
Internetmanufaktur Jo Meder ---------------------- Berlin, Germany
http://www.meder.de/ ------------------- fon: ++49-30-417 17 63 33
Kollwitzstr. 75 ------------------------ fax: ++49-30-417 17 63 45
10435 Berlin --------------------------- mob: ++49-170- 2 98 89 97
Public GnuPG-Key ---------- http://www.meder.de/keys/jo-pubkey.txt