It seems to me that the root problem is allocation spikes of legitimate, useful data. Perhaps then we need some sort of &quot;test&quot; to determine if those are legitimate. Perhaps checking every nth (with n decreasing as allocation bytes increases) object allocated during a &quot;spike&quot; could be useful. Then delay garbage collection until x consecutive objects are found to be garbage?<br>
<br>It seems like we should be attacking the root cause rather than finding some convoluted math that attempts to work for all scenarios.<br><br clear="all">On a side note, the information about not GCing on string objects is interesting? Is there a way to override this behavior? I&#39;ve found that re.py chokes on large text files (4MB plus) without line ends (don&#39;t ask, they&#39;re not our files but we have to parse them). I wonder if this isn&#39;t the reason...<br>
<br>If the answer to that is, &quot;no, strings are always ignored&quot; I&#39;d recommend rethinking this (or providing an option to override somehow.<br><br>-- <br>Haikus are easy<br>Most make very little sense<br>Refrigerator