instruments

Reliability of Xcode Instrument's disassembly time profiling

走远了吗. 提交于 2019-12-01 16:07:51
问题 I've profiled my code using Instrument's time profiler, and zooming in to the disassembly, here's a snippet of its results: I wouldn't expect a mov instruction to take 23.3% of the time while a div instruction to take virtually nothing. This causes me to believe these results are unreliable. Is this true and known? Or am I just experiencing an Instruments bug? Or is there some option I need to use to obtain reliable results? Is there any reference expanding on this issue? 回答1: First of all,

Memory profiling doesn't work with Xcode 9

流过昼夜 提交于 2019-12-01 14:44:04
问题 I am using the latest version of Xcode 9 and macOS 10.13. When I try to make a memory graph from the current state of my application, it shows an empty screen that says No Selection . I also tried to profile and work with Instruments, but it did not allow me to run due to a permission error. Target failed to run. Permission to debug [app name] was denied. I am aware of these threads and tried the suggestions available in them, but they didn't seem to work : Reddit - Has instruments stopped

Swift SpriteKit ARC for dummies

孤人 提交于 2019-12-01 11:47:49
I have been trying to wrap my head around strong reference cycles and I am struggling. I have been reading the documentation from apple and on some website and I feel like they dont really address my issues. I understand you have to use weak and unowned depending if the object can be nil or not. So say you have to 2 classes like this class Person { var dog: Dog? .... } class Dog { weak var person: Person? } that reference each other I know that one of them has to use weak/unowned. This is the classic example seen in most tutorials. I also have seen examples like this and they too make sense to

read data from a database or text file in instruments javascript script

馋奶兔 提交于 2019-12-01 09:01:48
I have a script like so: var target = UIATarget.localTarget(); var mainWindow = target.frontMostApp().mainWindow(); var element = mainWindow.textFields()["UserID"]; element.setValue("Hello World"); UIALogger.logStart("Logging element tree ..."); target.logElementTree(); UIALogger.logPass(); What I want to do is read a text file or database connection, so I can replace the "Hello World" with either a value from a text file or a database query. Is this possible in the Instruments application with using javascript to control UI Automation for the iphone simulator? Yes it is possible. You can

Memory leak checking using Instruments on Mac

為{幸葍}努か 提交于 2019-12-01 07:35:41
I've just been pulling my hair out trying to make Instruments cough up my deliberately constructed memory leaks. My test example looks like this: class Leaker { public: char *_array; Leaker() { _array=new char[1000]; } ~Leaker() { } }; void *leaker() { void *p=malloc(1000); int *pa=new int[2000]; { Leaker l; Leaker *pl=new Leaker(); } return p; } int main (int argc, char **argv) { for (int i=0; i<1000; ++i) { leaker(); } sleep(2); // Needed to give Instruments a chance to poll memory return 0; } Basically Instruments never found the obvious leaks. I was going nuts as to why, but then

XCode 5 Debug Navigator Memory disagrees with Instruments

蓝咒 提交于 2019-12-01 06:34:21
I'm working on my first ARC & Core Data project, basing this stage on Xcode's (Universal) Master-Detail template. I note that Xcode5 has a memory display in the Debug Navigator but when using it find its graph bears few similarities with mem usage displayed in Instruments when running a Leaks&Allocations trace. I've done the Instruments tracing with the Simulator (simulating both iPhone & iPad - in case the 'unloading' of the detail View with the latter makes a difference) and on an iPad2 & an iPodTouch. The results are broadly the same: iPhone 6.1 simulator Generation A--------1.13 MB

read data from a database or text file in instruments javascript script

余生长醉 提交于 2019-12-01 05:38:57
问题 I have a script like so: var target = UIATarget.localTarget(); var mainWindow = target.frontMostApp().mainWindow(); var element = mainWindow.textFields()["UserID"]; element.setValue("Hello World"); UIALogger.logStart("Logging element tree ..."); target.logElementTree(); UIALogger.logPass(); What I want to do is read a text file or database connection, so I can replace the "Hello World" with either a value from a text file or a database query. Is this possible in the Instruments application

How can I track down memory peaks? (That's peaks with a p, not an l.)

瘦欲@ 提交于 2019-12-01 03:42:05
I've got a kiosk app, which, essentially shows a bunch of slides with various bits of information on them. I initially began coding this over a year ago, when I was beginning with Objective-C and iOS development. I find that my code style is much cleaner now than what it was, and I'm much more experienced, so I've decided to rewrite from scratch. I ran my app with the Allocations instrument to see what the memory usage was. Considering that this is a kiosk app, everything needs to run smoothly, without leaks. (Of course all apps need to run without leaks, but a kiosk app makes this an even

Using heap shot analysis shows memory addresses, but not lines of code. How do I determine what is causing the heap to grow?

两盒软妹~` 提交于 2019-12-01 00:50:33
I'm nearly finished with my app and I'm using Instruments to optimize performance before I submit to the app store. I noticed that whenever I execute a particular action (updating the information in my app from an external server) my heap grows by about 350 KB. The research I found here on stackoverflow and Apple's documentation suggests executing Heap shots to find the offending code. However, instead of taking me to the offending code it shows me memory addresses. Is there a way to use this information? Or should I be using another tool? I'm pretty new with Instruments, so I appreciate any

Xcode Instruments error: “Allocations tracking library was not loaded in time”

廉价感情. 提交于 2019-11-30 23:20:15
问题 Problem started when installed Xcode5 bundle. I'm using Mavericks - not sure if that is relevant. Cannot profile allocations in simulator. Instruments would load and start app in the simulators but instead of allocations log I see this: Did anyone face this problem? 回答1: Also got this error: If the simulator was set to "iPhone" (iOS6), and active scheme was iOS7, then I got this error as well. Solution: So either set your active scheme to an iOS6 device, or change hardware in the simulator to