script uses up all memory

Chris Angelico rosuav at gmail.com
Thu Mar 6 17:28:42 EST 2014


On Fri, Mar 7, 2014 at 9:21 AM, Larry Martell <larry.martell at gmail.com> wrote:
> First I added del(self.tools) before the Django call. That did not
> stop the memory consumption. Then I added a call to gc.collect() after
> the del and that did solve it. gc.collect() returns 0 each time, so
> I'm going to declare victory and move on. No time to dig into the
> Django code. Thanks.

Not all problems need to be solved perfectly :) But at very least, I
would put a comment against your collect() call explaining what
happens: that self.tools is involved in a refloop. Most Python code
shouldn't have to call gc.collect(), so it's worth explaining why you
are here.

ChrisA



More information about the Python-list mailing list