https://github.com/antranapp/leakdetector
A SPM to support finding memory leaks for Swift projects.
https://github.com/antranapp/leakdetector
combine-framework ios leak-detection macos memory memory-leak memory-management swift
Last synced: 6 months ago
JSON representation
A SPM to support finding memory leaks for Swift projects.
- Host: GitHub
- URL: https://github.com/antranapp/leakdetector
- Owner: antranapp
- Created: 2020-11-13T13:31:54.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-12-29T02:15:55.000Z (almost 3 years ago)
- Last Synced: 2025-03-25T05:41:29.429Z (7 months ago)
- Topics: combine-framework, ios, leak-detection, macos, memory, memory-leak, memory-management, swift
- Language: Swift
- Homepage:
- Size: 16.6 MB
- Stars: 27
- Watchers: 1
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LeakDetector
## Introduction
`LeakDetector` is based on the implementation from [leakdetector](https://github.com/duyquang91/leakdetector) packge, which in turn is derived from the implementation of a leak detecktor in [UBER's RIB](https://github.com/uber/RIBs/tree/master/ios/RIBs/Classes/LeakDetector) framework.
In parallel to a RxSwift-based implementation, `LeakDetectorCombine` uses `Combine` framework to provide Combine-compatible APIs.
I accidently found another implementation of this `LeakDetector` from [LifeCycleKit](https://github.com/ashare80/LifecycleKit) which shares many similar ideas. The implementation in `LifeCycleKit` has much nicer APIs though. So I recommend you to take a look at the implementation of the `LeakDetector` in `LifeCycleKit` as well.
## Demo
There is a demo project to demostrate different use cases of the library.

This demo app focuses on common mistakes that could lead to retain cycles/memory leaks.
## References:
- RIBs: [https://github.com/uber/RIBs/tree/master/ios/RIBs](https://github.com/uber/RIBs/tree/master/ios/RIBs)
- LifeCycleKit: [https://github.com/ashare80/LifecycleKit](https://github.com/ashare80/LifecycleKit)
- You don’t (always) need [weak self]: [https://medium.com/flawless-app-stories/you-dont-always-need-weak-self-a778bec505ef](https://medium.com/flawless-app-stories/you-dont-always-need-weak-self-a778bec505ef)
- Everything you need to know about Memory Leaks in iOS: [https://medium.com/flawless-app-stories/all-about-memory-leaks-in-ios-cdd450d0cc34](https://medium.com/flawless-app-stories/all-about-memory-leaks-in-ios-cdd450d0cc34)
- swift-leak-check: [https://github.com/grab/swift-leak-check](https://github.com/grab/swift-leak-check)
- LifetimeTracker: [https://github.com/krzysztofzablocki/LifetimeTracker](https://github.com/krzysztofzablocki/LifetimeTracker)
- The Nested Closure Trap: [https://medium.com/flawless-app-stories/the-nested-closure-trap-356a0145b6d](https://medium.com/flawless-app-stories/the-nested-closure-trap-356a0145b6d)
- When to weakify: [https://jayeshkawli.ghost.io/when-to-weakify/](https://jayeshkawli.ghost.io/when-to-weakify/)