HeapInspector-for-iOS alternatives and similar libraries
Based on the "Code Quality" category.
Alternatively, view HeapInspector-for-iOS alternatives based on common mentions on social networks and blogs.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of HeapInspector-for-iOS or a related project?
Find memory issues & leaks in your iOS app
HeapInspector is a debug tool that monitors the memory heap with backtrace recording in your iOS app. You can discover memory leaks, no longer used objects, abandoned memory and more issues directly on your device without ever starting Instruments.
Memory heap snapshots with backtrace record
Basically you can inspect the entire heap and see all living objects of your iOS app.
To be more precise you can record the heap for a specific part of the app. For instance when navigating through the menu. Like in Apple's Instruments the snapshot compares the heap before you started recording. For instance you can start the snapshot before you push a new
UIViewController onto your
UINavigationController stack and stop after popping the
With HeapInspector and heap snapshots you can identify:
- Leaking objects
- Retain cycles
- Living objects that are no longer needed
- static objects like singletons or cached
- Dirty memory and your objects on the heap
HeapInspector gives you detailed information for the living objects:
- Reference history (backtrace support) See who called retain, strong, release
- Responder chain for recorded objects
- Screenshots of the inspected UIView, UIViewController, UIImage
- Detailed information about the object (Description, frame, properties, iVars, methods)
Since ARC has been introduced we don't need to manage the
release anymore. ARC is very powerful and makes Objective-C more stable. ARC decreased the number of crashes and improves the memory footprint. ARC is technically doing a powerful job. It knows when to
But ARC doesn't think about the overall architecture how to design for low memory usage. You should be aware that you can still do a lot of things wrong with your memory (even with ARC). You can still get memory pressures or peaks with ARC.
- You can still create Retain Cycles
strongproperty lifetime qualifier can be misused (i.e. holding an object twice and longer than needed.)
- Memory peaks through loops (if you're not using a proper
- Wrong caching with
And that's why we introduced HeapInspector to find those issues.
HeapInspector runs with Objective-C and Swift via CocoaPods
Just add the HeapInspector to your
pod install afterwards.
You can use Carthage. Specify in Cartfile:
Download the repository into your project via git or just as zip.
Drag it the
HeapInspector folder into your Xcode project. See following image.
Disable ARC for
NSObject+HeapInspector.m by adding
-fno-objc-arc to Xcode's Build Phases -> Compile Source. See example images here: [Drag](README_Xtras/drag.png) and [disable ARC](README_Xtras/no_arc.png)
How to use it
Make sure to import the header file Objective-C
Just run the following to start HeapInspector in a separated debug window. The window can be moved on your screen in order to reach all your UI elements. The left circle button starts / stops the memory heap snapshot. See demo above. Objective-C
We recommend to use a specific class prefixes, Swift modules or even a real classes like
Or just run
start to record all NSObject subclasses.
[HINSPDebug addClassPrefixesToRecord:@[@"RM", @"UITableView"];
Swift You can register modules for the heap snapshot and recordings.
Stopping and removing the inspector's window goes with Objective-C
Just call the start/stop methods at app launch or via your custom button.
HeapInspector can also record the backtrace for each object that received an alloc, retain, release or dealloc. Use this only with very specific recorded classes or in smaller apps. Start the backtrace with Objective-C
HeapInspector comes with an example project. There you will see a lot of mistakes made with the memory design.
NSTimerthat is not being invalidated properly
- Holding objects longer than needed.
strongproperty for the
UIViewControllerthat is pushed onto the
References, Inspirations & Thanks
- FLEX by Ryan Olson
- Mike Ash Friday Q&A Automatic Reference Counting
- Clang Objective-C Automatic Reference Counting (ARC)
*Note that all licence references and agreements mentioned in the HeapInspector-for-iOS README section above are relevant to that project's source code only.