[Pymilter] no memory release when assigning chunks to self.fp in milter-template.py

joao reis joao at 7lan.net
Tue Feb 4 16:47:03 EST 2020


I'm deleting the self.fp on close 
https://github.com/joaoreis81/milter-template/blob/master/milter-template.py:

def close(self):

	# always called, even when abort is called. Clean up

	# any external resources here.

	if self.fp:

	self.fp.close()

	self.fp = None

	del self.fp

	return Milter.CONTINUE



On 2/4/20 6:37 PM, Stuart D. Gathman wrote:
> On Tue, 4 Feb 2020, joao reis wrote:
>
>> Maybe the postfix implementation? I'm getting this from the 
>> Milter.getdiag():
>>
>> DIAGNOSTICO:(3401,3388)
>> DIAGNOSTICO:(3403,3388)
>> DIAGNOSTICO:(3403, 3388)
>
> 15 milter context objects active is pretty typical.
>
>>> In your close method, try deleting self.fp.  (del self.fp)
>>> If that doesn't "solve" your problem (it ought to happen 
>>> automatically),
>>> then you are keeping a reference to self.fp around somewhere.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gathman.org/pipermail/pymilter/attachments/20200204/fb4bdc15/attachment-0001.html>


More information about the Pymilter mailing list