zenoh icon indicating copy to clipboard operation
zenoh copied to clipboard

Fix memory leaks

Open DenisBiryukov91 opened this issue 1 year ago • 1 comments

Addresses a series of memory leaks detected by valgrind (Fixes #695 ):

  • due to cyclic references in Runtime and its dependents
  • due to cyclic references in Session and its dependents
  • due to cyclic references in Resource and its children
  • due to cyclic reference in Mux->Face->State->Mux
  • due to non-terminated tasks after Session.close()

Valgrind still reports some leaks, but they seem to be due to async_std (no mention of any Zenoh code, and similar "leaks" are also observed when running a simple hello world-type async example).

DenisBiryukov91 avatar Jan 31 '24 15:01 DenisBiryukov91

#566 is expected to land soon. I'd suggest to rebase this PR on #566 and to coordinate with @YuanYuYuan regarding task handling and management.

Mallets avatar Jan 31 '24 16:01 Mallets

@DenisBiryukov91 What's the latest status of this PR? Also, would be great if you can add the timeline to the respective issue

imstevenpmwork avatar Mar 14 '24 12:03 imstevenpmwork

@imstevenpmwork This was kind of finished for the main branch at the moment of last commit, but due to transition async-std->Tokyo, task termination part would likely need to be redone, so it is postponed until #566 is merged.

DenisBiryukov91 avatar Mar 14 '24 13:03 DenisBiryukov91