All Projects → tapwork → Heapinspector For Ios

tapwork / Heapinspector For Ios

Licence: mit
Find memory issues & leaks in your iOS app without instruments

Programming Languages

objective c
16641 projects - #2 most used programming language
shell
77523 projects
ruby
36898 projects - #4 most used programming language
swift
15916 projects

Projects that are alternatives of or similar to Heapinspector For Ios

Watchdoginspector
Shows your current framerate (fps) in the status bar of your iOS app
Stars: ✭ 497 (-72.68%)
Mutual labels:  monitoring, cocoapods, carthage, performance, performance-analysis, performance-visualization
Myperf4j
High performance Java APM. Powered by ASM. Try it. Test it. If you feel its better, use it.
Stars: ✭ 2,281 (+25.4%)
Mutual labels:  monitoring, performance, performance-analysis, performance-visualization
Import Cost
displays the import size of the package you are importing inside the code editor
Stars: ✭ 1,021 (-43.87%)
Mutual labels:  performance, performance-analysis, performance-visualization
Lighthouse Monitor
Investigate performance over your whole company with lighthouse
Stars: ✭ 136 (-92.52%)
Mutual labels:  monitoring, performance, performance-analysis
Scouter Paper
scouter-paper is a web client software for scouter
Stars: ✭ 183 (-89.94%)
Mutual labels:  monitoring, performance, performance-visualization
Sparklens
Qubole Sparklens tool for performance tuning Apache Spark
Stars: ✭ 345 (-81.03%)
Mutual labels:  performance, performance-analysis, performance-visualization
Scalene
Scalene: a high-performance, high-precision CPU, GPU, and memory profiler for Python
Stars: ✭ 4,819 (+164.93%)
Mutual labels:  performance-analysis, memory-management, memory-allocation
Inspectit
inspectIT is the leading Open Source APM (Application Performance Management) tool for analyzing your Java (EE) applications.
Stars: ✭ 513 (-71.8%)
Mutual labels:  monitoring, performance, performance-analysis
Pcm
Processor Counter Monitor
Stars: ✭ 1,240 (-31.83%)
Mutual labels:  monitoring, performance-analysis, performance-visualization
Ducttape
📦 KeyPath dynamicMemberLookup based syntax sugar for Swift.
Stars: ✭ 138 (-92.41%)
Mutual labels:  cocoapods, carthage
Fgprof
🚀 fgprof is a sampling Go profiler that allows you to analyze On-CPU as well as Off-CPU (e.g. I/O) time together.
Stars: ✭ 1,944 (+6.87%)
Mutual labels:  performance, performance-analysis
Pinpoint
APM, (Application Performance Management) tool for large-scale distributed systems.
Stars: ✭ 11,883 (+553.27%)
Mutual labels:  monitoring, performance
Closures
Swifty closures for UIKit and Foundation
Stars: ✭ 1,720 (-5.44%)
Mutual labels:  cocoapods, carthage
Deli
Stars: ✭ 148 (-91.86%)
Mutual labels:  performance, performance-analysis
Poliopager
A flexible TabBarController with search tab like SNKRS.
Stars: ✭ 133 (-92.69%)
Mutual labels:  cocoapods, carthage
Pipkit
Picture in Picture for iOS
Stars: ✭ 140 (-92.3%)
Mutual labels:  cocoapods, carthage
Donut
Donut is a library for arranging views circularly like a donut.
Stars: ✭ 141 (-92.25%)
Mutual labels:  cocoapods, carthage
Contentful.swift
A delightful Swift interface to Contentful's content delivery API.
Stars: ✭ 132 (-92.74%)
Mutual labels:  cocoapods, carthage
Scouter
Scouter is an open source APM (Application Performance Management) tool.
Stars: ✭ 1,792 (-1.48%)
Mutual labels:  monitoring, performance
Sdl ios
Get your app connected to the 🚙, make your users feel like a 🌟
Stars: ✭ 147 (-91.92%)
Mutual labels:  cocoapods, carthage

HeapInspector

Find memory issues & leaks in your iOS app

Build Status CocoaPods Version CocoaPods Platform Carthage Compatible Twitter

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 UIViewController. 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 UIImage
  • 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)

In Action

HeapInspector

Why

Since ARC has been introduced we don't need to manage the retain & 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 retain, autorelease and release.
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
  • The strong property 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 @autoreleasepool)
  • Wrong caching with static

And that's why we introduced HeapInspector to find those issues.

Installation

CocoaPods

HeapInspector runs with Objective-C and Swift via CocoaPods Just add the HeapInspector to your Podfile.

pod "HeapInspector"

and run pod install afterwards.

Carthage

You can use Carthage. Specify in Cartfile:

github "tapwork/HeapInspector-for-iOS"

Manual

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 and disable ARC

How to use it

Make sure to import the header file
Objective-C

@import HeapInspector;

Swift

import HeapInspector

Start

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

[HINSPDebug start];

Swift

HINSPDebug.start()

We recommend to use a specific class prefixes, Swift modules or even a real classes like UIImageView. Or just run start to record all NSObject subclasses.
Objective-C

[HINSPDebug addClassPrefixesToRecord:@[@"RM", @"UITableView"];

Swift You can register modules for the heap snapshot and recordings.

HINSPDebug.addSwiftModulesToRecord(["MyModule", "AnotherFrameworkModule"])

Stop

Stopping and removing the inspector's window goes with
Objective-C

[HINSPDebug stop];

Swift

HINSPDebug.stop()

Just call the start/stop methods at app launch or via your custom button.

Backtrace record

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

[HINSPDebug recordBacktraces:YES]; 

Swift

HINSPDebug.recordBacktraces(true)

Example project

HeapInspector comes with an example project. There you will see a lot of mistakes made with the memory design.

  • strong delegate properties
  • NSTimer that is not being invalidated properly
  • Holding objects longer than needed. strong property for the UIViewController that is pushed onto the UINavigationController stack

References, Inspirations & Thanks

Author

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].