instruments

Guide to acceptable “Live Bytes” of iOS6 app using MKMapView

被刻印的时光 ゝ 提交于 2019-11-30 05:39:41
问题 I am looking to ensure my app does not consume too much memory on what are still fairly resource constrained devices. Several days ago I was using Instruments to determine how much memory my app was using and I was getting around 4-8 megabytes for Live Bytes . Today I run Instruments again and I am up around 30-35 megabytes for Live Bytes. I don't believe I have made any significant changes to my code between these two times. My app uses an MKMapView with a custom tile overlay. I put off

Can Instruments be used using the command line?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 05:02:53
问题 Can Instruments be used as a replacement for valgrind If one wants to check for memory leaks using instruments can it be used from the terminal? 回答1: Instruments has a command line interface: $ instruments -h Example usage: $ instruments -t mytemplate -a myapp.app For leaks, try the Leaks.tracetemplate . To see all available templates, use -s . There is another executable, just called leaks . You can inspect any running application by giving leaks its PID: $ ps aux | grep "[b]ash" | awk '

Xcode Instruments trace comparison

Deadly 提交于 2019-11-30 03:41:24
问题 Is there any way to compare trace files saved with Instruments. How can I have a comparison of any way regarding consecutive realise builds of the app. Lest's say I release iPhone app version 1.0 then in 2 months 1.1. What's is the best have to have a profiling comparison in terms of memory and time? 回答1: You can save trace files. But to make is reasonable to interpret those results at a future date, it's useful to insert "flags" in your trace, to mark significant events, so that you can tell

Instruments Leaks - Not showing my source code

末鹿安然 提交于 2019-11-30 02:33:30
I am attempting to analyze an iPhone application using the Leaks application and everything appears to be working fine, except for when I try to view detailed information about a particular memory leak. Leaks does not appear to be loading my source code. Looking at the stack view on the right, I can see calls that reference iPhone frameworks, but anything that is referencing source code that I've written is empty. The screenshot below illustrates my point. The blocks that are light blue should be referencing my source code. Has anyone ever had this problem? Is Leaks just not finding my source

How to find out what mach_msg_trap waits for?

a 夏天 提交于 2019-11-30 01:25:58
I a profiling my iPhone application on target, and according to Instruments 65% of the time is spent in mach_msg_trap . I have a background thread that runs-forever and send results back to the main thread using performSelectorOnMainThread:withObject:waitUntilDone: , aproximately every 2 seconds. I am not waiting until done. Turn out my app is not actually spending 65% of it's time in the mach_msg_trap function. It was a configuration error in Instruments on my part. The Sampler tool defaults to All Sample Counts , this will measure all threads regardless of their state. Instead switch to

Why am I seeing “An error occurred while trying to run the script.” in the UI Automation instrument?

空扰寡人 提交于 2019-11-30 01:13:52
问题 When I try to run a UI Automation script on iOS 5 devices I am getting the following error: "An error occurred while trying to run the script." The same script is running perfectly in the simulator or on an iOS 4.3.3 device. How can I solve this problem? 回答1: This should fix this issue: sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer 回答2: On devices you should explicity allow to run UI Automation scripts. Go to Settings -> Developer Switch Enable UI Automation to on After

Where did Instruments go in Xcode 4.3?

試著忘記壹切 提交于 2019-11-30 00:27:30
问题 I have just updated from 4.2 to Xcode 4.3 and "Instruments" is no longer there. I tried to run it from Launchpad but was informed that this is not possible because Instruments is in the trash bin. Xcode 4.3 uninstalled 4.2 but it seems it did not bother installing a new version of Instruments. 回答1: You can launch Instruments from within Xcode. It is no longer in the /Developer folder but in /Applications/Xcode.app/Contents/Developer . From the menu bar, choose Xcode > Open Developer Tool >

use instruments - leaks with a device

一个人想着一个人 提交于 2019-11-29 22:03:25
I'm starting to use Instruments-Leaks with an iPhone 3G. When I try to run the app with Instruments on the iPhone I obtain Target failed to run: Remote exception encountered: 'Failed to get task for pid 280' Ideas? The only time I succeed in running the app with instruments it run very slow, I couldn't test it. What are the steps to run the app on the device searching for leaks? The solution for me was to make sure that my Profile scheme was using the "debug" and not "release" build configuration. In Xcode 4 select Product/Edit Scheme from the top menu then click on the "profile" button on the

Is there anyway to read performance counters on OS X Mountain Lion?

。_饼干妹妹 提交于 2019-11-29 20:27:50
Shark, Apple's profiler which let you configure custom performance counters, is no longer supported in OSX Mountain Lion since it can't run a 32-bit kernel. Instruments.app, Apple's replacement for Shark, doesn't seem to support reading performance counters such as L1 cache hits/misses**. Is there anyway to actually setup and read performance counters on OS X? Even if there is no application, is there some user-land API to do this? **Instruments.app does seem to have an interface for performance counters, but on my Retina MacBook Pro, the PM Events window lists no events, and indicates "Device

Understanding Instruments in Xcode, testing for leaks

断了今生、忘了曾经 提交于 2019-11-29 20:21:00
I just started using Instruments, a nice little tool for testing memory allocations/ leaks and all that great stuff. But I'm pretty confused at how it works... Ive looked for tutorials explaining how to work with it, but no tutorials explained what to do with it. I'll try to explain this: I have it set up to whenever I run my Xcode app, Instruments tracks everything. But the stuff that instruments record makes no sense to me. There was one leak discovered, and after that it started leaking bytes. It says the leaked object is _NSCFString and some other stuff like that. Here is a screenshot My