• Home
  • What is ?
  • DSA
  • MAD
  • Concept
  • Practice
  • Misc
  • Quiz
  • YT
  • Home
  • What is ?
  • DSA
  • MAD
  • Concept
  • Practice
  • Misc
  • Quiz
  • YT
  • #News
  • #APPS
  • #Events
    • #WWDC
    • #I/O
    • #Ignite
  • #Let’s Talk
  • #Interview
  • #Tips

MyCodeTips mycodetips-newlogocopy1

  • Home
  • What is ?
  • DSA
  • MAD
  • Concept
  • Practice
  • Misc
  • Quiz
  • YT
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.

Liked it? Take a second to support Ranjan on Patreon!
Become a patron at Patreon!
  • 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)
  • More
  • Click to share on Pocket (Opens in new window)
  • Click to share on Pinterest (Opens in new window)
Written by Ranjan - 2066 Views
Tags | IOS, Tools
AUTHOR
Ranjan

Namaste, My name is Ranjan, I am a graduate from NIT Rourkela. This website is basically about of what i learnt from my years of experience as a software engineer on software development specifically on mobile application development, design patterns/architectures, its changing scenarios, security, troubleshooting, tools, tips&tricks and many more.

You Might Also Like

mycodetips-newlogo2

How to Create iCal event in IOS

June 19, 2014
objective-c-control-statements2

Objective-C control statements and loops !

October 21, 2021
mycodetips-newlogo2

How to validate or Allow Only Numeric value TextField in IOS or objective-c

September 26, 2013
Next Post
Previous Post

Support us

mycodetips
mycodetips

Follow us @ LinkedIn 2850+

Subscribe for updates

Join 8,213 other subscribers

Latest Posts

  • YT-Featured-solidprinciples
    SOLID Principles of Software Design
  • IOS 16 Features
    Latest features in IOS 16
  • r-language
    How can R language be used for data analysis?
  • wordpress-coding-blog
    Guide To WordPress Coding Standards
  • YT-Featured-Algorithm
    What is Algorithm?
whiteboard

Whiteboard(PRO)

whiteboard

Whiteboard(lite)

alphabets

Kids Alphabet

techlynk

Techlynk

techbyte

Do2Day

techbyte

Techbyte

  • #about
  • #myapps
  • #contact
  • #privacy
  • #Advertise
  • #myQuestions

Android Android Studio API APP Programming Apps blogging CSS DATABASE dsa Features HTML HTML5 installation Interview Questions IOS iPhone javascript Mac objective-c OS Programming quicktips SDK SEO SQL swift Tips & Tricks Tools UI Web Wordpress Xcode

  • SOLID Principles of Software Design
  • Latest features in IOS 16
  • How can R language be used for data analysis?
  • Guide To WordPress Coding Standards
  • What is Algorithm?

©mycodetips.com