CodeEditApp/CodeEdit

🐞Memory Leaks in SearchKit Result Retrieval

tom-ludwig opened this issue · 0 comments

Description

There have been persistent memory leaks observed during the retrieval of search results from SearchKit. The root cause was identified as the incorrect use of .takeUnretainedValue() method. This misuse led to a discrepancy in the memory management, resulting in thousands of objects not being deinitialized properly. The memory leaks caused an increase in memory usage over time, potentially degrading the performance of the app.

To Reproduce

  1. Perform multiple search operations using the SearchKit.
  2. Monitor the memory usage through a profiling tool.
  3. The number of leaks should increase every time you perform a search.

Expected Behavior

At the end of the function the RefCount should be 0 for each object form SeachKit.

Version Information

CodeEdit: 0.1.0-dev (38)
macOS: 15.4
Xcode: 14.5

Additional Context

No response

Screenshots

Screenshot 2024-05-24 at 2 26 26 PM Screenshot 2024-05-24 at 2 25 00 PM Screenshot 2024-05-24 at 2 24 38 PM