• Home
  • Troubleshoot
  • #Example
    • C
    • C++
    • Python
    • R-Programming
  • DSA
  • Quiz
  • Tutorial Videos
  • Home
  • Troubleshoot
  • #Example
    • C
    • C++
    • Python
    • R-Programming
  • DSA
  • Quiz
  • Tutorial Videos
  • #Deals
  • #News
  • #WiKi
  • #APPS
  • #Events
    • #WWDC
    • #I/O
    • #Ignite
  • #Let’s Talk

MyCodeTips mycodetips-newlogocopy1

  • Home
  • Troubleshoot
  • #Example
    • C
    • C++
    • Python
    • R-Programming
  • DSA
  • Quiz
  • Tutorial Videos
IOS, Tools

Debug memory leaks with XCode Instruments

Debug memory leaks with XCode Instruments

Using Appcelerator doesn’t mean you don’t have to take care of memory leaks. Odds are there is at least one leak in your app right now. Relatively unknown is that this can be easily detected with some XCode Instruments. I’ll show you how.

Walkthrough

Run your app from Titanium Studio or CLI in the Simulator or on a device. Then launch XCode and go to Xcode > Open Developer Tool > Instruments

Now choose Allocations

In the drop down menu go to Attach to Process and select your app in the System section if it runs in Simulator or on the device listed. The list is not alphabetically sorted so keep looking 🙂

Filtering

Filter on TiUI or Proxy and you will see the Titanium objects appearing while navigating through your app. The objects should be disappearing when they are no longer active. Each label will appear as a TiUILabel so you won’t know which label. Try to debug one window at a time so you get a better idea where the leak is exactly.

Gotcha

Be aware of the fact that when you are running in the Simulator the amount of memory is equal to your Mac. Garbage collection might take a while because of that. Unfortunately there is no way to manually trigger the garbage collector. A workaround is hooking the Allocation instrument up to a device with little memory.

  • Click to share on Reddit (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on Twitter (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Tumblr (Opens in new window)
  • Click to share on Pocket (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
Written by Ranjan - 1510 Views
Tags | IOS, Tools
AUTHOR
Ranjan

I m Ranjan and Sharing my years of experience in Software Development. Love to code in Mobile apps (IOS, Android, Power Apps, Xamarin, Flutter), Machine Learning ( Beginner ), Dot Net, Databases ( SQL Server, MySql, SQLite), WordPress, Cloud Computing ( AWS, Azure, Google, MongoDB) and many more as required on project-specific. Besides this love to travel and cook.

You Might Also Like

mycodetips-swift

Evolutions of Swift Programming Language

November 1, 2020
if-else-if-else

Conditionals in Swift ( If, Else If, Else )

August 5, 2021
restore iphone

How to Restore iPhone or iPad

September 14, 2019
Next Post
Previous Post

Subscribe for updates

Join 6,873 other subscribers

whiteboard

Whiteboard(PRO)

whiteboard

Whiteboard(lite)

alphabets

Kids Alphabet

techlynk

Techlynk

techbyte

Do2Day

techbyte

Techbyte

Latest Posts

  • Frameworks of IOS
    Frameworks of IOS – Part ( I )
  • NSFileManager or NSPathUtilities
    NSFileManager or NSPathUtilities in Objective-C
  • Passing data between view controllers in Objective-C
    Passing data between view controllers in Objective-C
  • structures-classes-enum
    Structures and Classes in swift !
  • control-system-swift
    Control Flow in Swift
  • swift-concurrency-await
    Concurrency in Swift
  • time-complexity-dsa
    The Term Time Complexity in DSA
  • objective-c-datatypes1
    Objective-C Data Types
  • Convert-jpeg-word
    Convert JPG to Word – Tips You Should Try!
  • objective-c-control-statements2
    Objective-C control statements and loops !

Quick Links

  • #about
  • #myapps
  • #contact
  • #privacy

Other Websites

  • #myQuestions
  • #myBhojanalaya
  • #gadgetFacts
  • #ifscCodesDB

Tag Cloud

Android Android Studio API APP Programming Apps AS400 blogging Browser C# Code Config CSS DATABASE error Features HTML HTML5 IDE installation Interview Questions IOS IOS Features iPhone JAVA javascript Mac objective-c OneDrive OS Programming quicktips SDK SEO Settings SMO SQL swift swiftUI Teams Tips & Tricks Tools UI Web Wordpress Xcode

©mycodetips.com