instruments

iOS memory usage increasing, can't find the culprit

佐手、 提交于 2019-11-28 12:03:57
I'm attempting to download a large number of images using AFNetworking 2.5 and stream them to disk. According to the memory monitor in Xcode, this is causing unbounded memory growth (and eventually memory warnings and force quits) - but profiling the memory usage using the allocations instrument shows the memory usage to be stable. I'd like to think Xcode is just wrong here, but then why would my app be getting killed by iOS? Instruments shows this - the peaks are Core Data queries, then the rest is the images downloading - peaks at about 9.5MB, the rest sits at about 8.5MB I've also tried

Live Bytes vs Real Memory in Activity Monitor on iOS

亡梦爱人 提交于 2019-11-28 08:35:32
I'm working on an iOS app that will create a lot of small objects and floats, and trying to get an idea for how much memory usage it's consuming. When I run the "Allocations" instrument, it says I have about 2MB of "Live Bytes", and the figure stays roughly constant as I move through the app (spikes up to 3MB or so when the App is busy, but then drops back down to 2MB). But when I run the "Activity Monitory" instrument, my app's "Real Memory" is 25MB once it finishes launching, and grows rapidly whenever drawing occurs inside my CALayer. In less than a minute, it goes over 100MB. Why would

Time profiler doesn't show me functions

萝らか妹 提交于 2019-11-28 06:08:21
问题 In tutorial, when someone debug app they see something like this: But when i start recording, by pressing red button: I see this... 回答1: Make sure the Generate Debug Symbols build setting is set to Yes. You need debug symbols to have function names appear in Instruments. If your project is generating debug symbols, Instruments may not be able to find your project's dSYM file. In Instruments choose Instrument > Call Tree Data Mining > Locate dSYM file to find and open your project's dSYM file.

Can't release unused CALayer memory when using multiple layers

≡放荡痞女 提交于 2019-11-28 05:29:17
问题 I am using multiple CALayer's in my application with large UIImage as contents. unfortunately, when I don't need the layer nor the image - the memory is not freed. the code I use to create the layer is: UIImage *im = [UIImage imageNamed:@"image_1.jpg"]; CALayer * l = [CALayer layer]; [l setBounds:CGRectMake(0, 0, 1024, 768)]; [l setPosition:CGPointMake(512, 384)]; [l setAnchorPoint:CGPointMake(0.5, 0.5)]; [l setHidden:NO]; [l setContents:(id) im.CGImage]; [self.layer addSublayer:l]; // self

Using Instruments to test an iOS app without having source code to the application

旧城冷巷雨未停 提交于 2019-11-28 04:58:40
问题 I would like to use UIAutomation via Instruments in Xcode to test an app on my iOS device. Is it possible to do so without having to build the source code? The reason for this is that our team will have testers who will be writing automation scripts to test the apps on our devices, but we don't want them to all go through syncing to latest builds and compiling it through Xcode. Does anyone know if this is possible through UIAutomation or possibly through a 3rd party application? Thanks. 回答1:

XCode Instruments Allocations: Look at Live Bytes or Overall Bytes?

这一生的挚爱 提交于 2019-11-28 03:57:53
I am getting some memory warning in my iOS app so I am running Instruments to see the allocations. Should I look at the * All Allocations * Live Bytes or Overall Bytes? Someone said the iOS can close my app if I use for 22MB, is that from the Live or Overall bytes section? zaph Live Bytes is the current usage and is what you are interested in, overall bytes includes all released allocation. The other thing is to look at the graph and look for peaks. As an example I saw a huge peak of about 27MB in an app I was working on, knowing that I was able to reduce peak memory usage to 8MB. Also watch

Leaks in Swift 3 / iOS 10

谁都会走 提交于 2019-11-28 03:55:27
问题 When I'm running instruments and check for leaks, it's showing leaks mainly consisting of: _ContiguousArrayStorage<String> _NativeDictionaryStorageOwner<Int, CGFloat> _NativeDictionaryStorageOwner<String, AnyObject> This is when I'm using Swift 3 and testing on devices using iOS 10. The leaks only show up in iOS 10 while on iOS 9.x everything seems to be normal. On top of that, in iOS 10 UISwitch doesn't seem to deallocate either. Currently I've been creating all kinds of workarounds trying

What do “Dirty” and “Resident” mean in relation to Virtual Memory?

非 Y 不嫁゛ 提交于 2019-11-28 03:34:37
I dropped out of the CS program at my university... So, can someone who has a full understanding of Computer Science please tell me: what is the meaning of Dirty and Resident, as relates to Virtual Memory? And, for bonus points, what the heck is Virtual Memory anyway? I am using the Allocations/VM Tracker tool in Instruments to analyze an iOS app. * Hint - try to explain as if you were talking to an 8-year old kid or a complete imbecile. Thanks guys. "Dirty memory" is memory which has been changed somehow - that's memory which the garbage collector has to look at, and then decide what to do

How to measure total time spent in a function?

夙愿已清 提交于 2019-11-28 00:52:12
问题 I have a utility function that I suspect is eating up a large portion of my application's execution time. Using Time Profiler to look at the call stack, this function takes up a large portion of the execution time of any function from which it is called. However, since this utility function is called from many different sources, I am having trouble determining if, overall, this is the best use of my optimization time. How can I look at total time spent in this function during program