Building applications that are clean and have small memory footprint is a necessity for iOS development. If you have a lot of retain cycles or memory related issues, there's a good chance that you'll experience either early terminations or unexpected behavior with your code. To solve these problems, I'll first show you how to identify issues by overriding deinit. Then we'll look at removing the firebase snapshot retain cycle, as well as other problems. Enjoy.