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

joao reis joao at 7lan.net
Tue Feb 4 16:53:30 EST 2020


With "del self.fp" it is consuming 244.6 MiB in just one hour.

On 2/4/20 6:47 PM, joao reis wrote:
>
> 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.
>>
>
> _______________________________________________
> Pymilter mailing list
> Pymilter at gathman.org
> https://gathman.org/mailman/listinfo/pymilter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gathman.org/pipermail/pymilter/attachments/20200204/f1b84e11/attachment.html>


More information about the Pymilter mailing list