dls-controls / aioca

Asynchronous Channel Access client for asyncio and Python using libca via ctypes
Apache License 2.0
6 stars 3 forks source link

Possible memory leak #26

Closed shkw0k closed 2 years ago

shkw0k commented 2 years ago

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?

coretl commented 2 years ago

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

coretl commented 2 years ago

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!