rxswift-memory-check
Swift memory leak detection for iOS: identifies missing dispose bags, retain cycles, and strong self references in RxSwift code.
Introduction
The rxswift-memory-check skill provides a specialized diagnostic workflow for iOS developers working with RxSwift. It systematically analyzes Swift source code to uncover common memory management anti-patterns that lead to memory leaks, performance degradation, and application crashes. By scanning for missing dispose bags and improper closure captures, it ensures that your reactive stream lifecycles are correctly managed within ViewModels, ViewControllers, and other reactive components.
-
Automated detection of missing .disposed(by: disposeBag) calls in subscriptions.
-
Identification of retain cycles caused by strong self references within subscription closures.
-
Verification of DisposeBag declaration scope to prevent premature cancellation or memory retention.
-
Comparison of current implementation against recommended practices for [weak self] vs [unowned self] usage.
-
Generation of actionable diagnostic reports including file locations, severity levels, and code-fix suggestions.
-
Best for developers debugging memory growth, frequent crashes, or performance bottlenecks in RxSwift-heavy codebases.
-
Ideal for use during peer code reviews, pull request assessments, and proactive code quality audits.
-
Inputs: Parses standard Swift files to locate .subscribe() patterns and closure captures.
-
Outputs: Provides a markdown report containing critical issues, file-specific warnings, and concrete refactoring advice.
-
Constraints: Focuses exclusively on RxSwift-related patterns; requires manual verification with Xcode Instruments or Debug Memory Graph for complex deallocation scenarios.
Repository Stats
- Stars
- 1
- Forks
- 0
- Open Issues
- 0
- Language
- Shell
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- May 3, 2026, 03:03 PM