[ovirt-devel] [VDSM] Avoiding leaks when handling exceptions

Nir Soffer nsoffer at redhat.com
Mon Sep 5 06:48:49 UTC 2016


On Mon, Sep 5, 2016 at 9:27 AM, Dan Kenigsberg <danken at redhat.com> wrote:
> On Sun, Sep 04, 2016 at 08:38:30PM +0300, Nir Soffer wrote:
>> Hi all,
>>
>> I found an interesting post about error handling and how to avoid such
>> leaks - please check:
>> https://cosmicpercolator.com/2016/01/13/exception-leaks-in-python-2-and-3/
>>
>> Nir
>
> Interesting. Afrer enough time, we would have one traceback object per
> live thread, and we may have plenty of such object prior to garbage
> collection.
>
> Have you tried if running gc.collect() clears these stale traceback
> objects you've seen?

I have seen living tracebacks in a system doing gc.collect once per
minute (health monitor enabled), but I did not monitor yet the instances,
not sure how much time each instance was living.

I also did not check how much memory was reference by each traceback,
this needs more time to research.

Regardless I think we should start to be more careful about these.

Nir



More information about the Devel mailing list