A reference cycle is a loop of strong object references that keeps every object in the loop alive, even after the application no longer needs it. On iOS, cycles commonly arise when closures capture their owner, delegates retain each other, or notification listeners remain registered. section 7.3.3
Detect and break cycles systematically:
- Repeat an action such as navigating away from and back to a screen; growing object counts or memory indicate unreleased data. section 7.3.3
- Use Allocations to identify growth and Leaks to inspect the object types, sizes, and reference paths sustaining them. section 7.3.3
- Change one strong reference to weak when two objects retain each other, then verify that memory returns after navigation. section 7.3.3
Account overview navigation
Returning to an account overview adds 8MB because transaction data and decoded images remain retained after the screen disappears. A leak diagram reveals the cycle; weakening one reference lets memory recover. section 7.3.3
