An iOS library that detects retain cycles in Objective-C and Swift applications using runtime analysis.
FBRetainCycleDetector is an iOS library that helps developers find retain cycles—a type of memory leak where objects reference each other in a loop, preventing deallocation. It performs runtime analysis on object graphs to automatically detect these cycles, which are common in Objective-C and Swift code and can degrade app performance. The tool integrates into debug builds to provide insights during development.
iOS developers working on Objective-C or Swift applications who need to identify and fix memory leaks, particularly those caused by retain cycles. It's especially useful for developers maintaining large or complex codebases where manual detection is impractical.
Developers choose FBRetainCycleDetector because it offers automated, runtime-based detection of retain cycles, which are notoriously hard to spot manually. Its configurability (e.g., filters, timer inspection) and integration with tools like FBAllocationTracker provide a flexible and powerful approach to memory profiling not easily matched by basic Xcode instruments.
iOS library to help detecting retain cycles in runtime.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Analyzes object graphs during execution to automatically find circular references, catching issues that static analysis or manual inspection might miss, as highlighted in its proactive philosophy.
Allows exclusion of known safe retain cycles, such as UIView's _subviewCache, using filter blocks to reduce false positives and focus on genuine leaks.
Detects tricky retain cycles involving NSTimer and associated objects (with FBAssociationManager hook), addressing common memory leak sources that are hard to spot manually.
Works seamlessly with FBAllocationTracker and FBMemoryProfiler, offering a comprehensive memory profiling suite for deeper analysis and UI-based tracking.
Primarily designed for debug configurations, requiring compilation flags for other builds, which limits its use in production environments or continuous monitoring.
Needs early application hooking in main.m to track associated objects, adding complexity and potential risk to project initialization and maintenance.
Runtime analysis can be slow, especially with larger cycle lengths, impacting app performance during detection, as noted in the adjustable cycle length trade-off.
Output format is described as 'pretty hard to look at,' requiring developers to parse wrapped object arrays, which can be non-intuitive without additional tooling.