Skip to content

Fix retain cycle(s) in encoder implementation

Compare
Choose a tag to compare
@VaporBot VaporBot released this 23 Nov 19:08
· 11 commits to main since this release
79fbcfb
This patch was authored by @petrpavlik and released by @0xTim.

This PR addresses issue #215 and server as an alternative of PR #216, that somehow got stuck in it's efforts of being merged in.

I've done 2 things to discover the issue and confirm the fix

  • Xcode would show a bunch of memory leaks when using it's memory graph debugger, those are gone after the changes introduced in this PR
  • I've switched https://swiftpack.co, which uses leaf heavily, to using my fork with this fix. The heroku graph bellow shows significantly lower memory consumption and does not seem to be crashing, though I still do do seem to have memory leaks somewhere in the codebase.

Screenshot 2022-10-11 at 8 09 09

Screenshot 2022-10-09 at 18 38 05

Screenshot 2022-10-09 at 18 35 00

Screenshot 2022-10-09 at 18 36 58

Screenshot 2022-10-09 at 18 32 46

Screenshot 2022-10-09 at 18 35 33