<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 17, 2014 at 6:06 PM, Glyph Lefkowitz <span dir="ltr"><<a href="mailto:glyph@twistedmatrix.com" target="_blank">glyph@twistedmatrix.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div class="im"><br><div><div>On Jan 17, 2014, at 12:43 PM, Jonathan Vanasco <<a href="mailto:twisted-python@2xlp.com" target="_blank">twisted-python@2xlp.com</a>> wrote:</div>
<br><blockquote type="cite"><br>some recent changes to a very-happy twisted daemon have resulted in a process that grows in memory until it crashes the box.  boo!<br><br>looking through the code and logs, i'm wondering if i''ve coded things in such a way that defferds or deferrd lists are somehow not getting cleaned up if an unhandled exception occurs. <br>
<br>i've been looking through all my former notes and some questions on stack overflow, and I've seen a lot of info on using heapy and other tools to find issues on a function-by-function basis.  <br><br>i'm wondering if anyone has experience in simply monitoring the lifecycle of deferreds ?<br>
</blockquote><br></div></div><div>First off, just manhole in and inspect gc.garbage :-).</div><div><br></div></div></blockquote><div><snip> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><span class="HOEnZb"><font color="#888888"><div><br></div><div>-glyph</div></font></span></div></blockquote></div><br>I had a similar situation several years ago, and messed around with heapy and some other Python memory profiling tools, but the manhole + gc.garbage was both the easiest and most effective.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">One other thing I did was to set up a separate Twisted Service that would run a memory profiling function periodically (I think it just looked at gc.garbage, and sorted things nicely) and log it.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I used txScheduler (which I wrote) for that.  In fact that's part of why I wrote it.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I can't give you much more detail than that, though.  It was over 5 years ago, and I don't have access to that code any more.<br clear="all">
<div><br></div><br>--<div>Kevin Horn</div>
</div></div>