dls-controls / aioca

Asynchronous Channel Access client for asyncio and Python using libca via ctypes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible memory leak

shkw0k opened this issue · comments

In __create_signal_task(), a task is appended to the list self.__tasks, but never removed from the list.
This list grows without bound.
The list of tasks is needed so that we can cancel them when closing.
But do we need that for events?

@aawdls this might be our coniql memory leak...

Thanks for this @shkw0k, we were hunting for a memory leak in another application that uses aioca. We need to keep track of tasks so that we can cancel callbacks when the subscription is closed, but I've added a Task callback that removes itself from the set when it completes so this memory leak has gone. I've released 1.4 with this in it, hopefully it fixes things for you!