Advanced Memory Management in Swift (Part 2)
Alternatives to Reference Counting, Autorelease Pool, Lazy Initialization
My last video on memory management in Swift (for now) covers a few more advanced-level questions: how lazy initialization helps make your app feel faster; how autorelease pool gives you more control over objects’ deallocation; why reference counting seems like the optimal choice for apps on your phone or laptop; and what else is out there in terms of memory management (not on the Apple platforms, though).
Links
- Lazy stored properties in Swift
- Autorelease pool
- Autorelease pool usage
- Objective-C memory management policy
- Objective-C naming conventions
- Cocoa naming conventions
- Manual memory management in Swift
- Garbage collection explanation by Computerphile
- Garbage collection in detail
- Garbage collection in Cocoa (outdated)
- Ancient Cocoa × Java documentation (just a relic of the past; it’s totally useless today)
- Memory management in Rust (from Google’s Comprehensive Rust)
- Rust’s ownership concept, explained (from the Rust Book)