Instruments

RSS for tag

Instruments is a performance-analysis and testing tool for iOS, iPadOS, watchOS, tvOS, and macOS apps.

Instruments Documentation

Posts under Instruments subtopic

Post

Replies

Boosts

Views

Activity

Memory Graph - Unable to acquire required task port
I'm trying to find memory leaks in my application with either Memory Graph or Inspector. I'm getting the following errors:Memory Graph - Unable to acquire required task portInspector Prompts for passwordError: Failed to attach to target processAn error occurred trying to capture Leaks data.Unable to acquire required task port ()The odd thing is that both work on initial execution of the target, but every subsequent launch triggers the above errors. (including after restarting xcode and after reboot).If I change my target name it works one time and then the errors start again. So the target name is being cached somewhere and causing subsequent testing with that name impossible.I'm running xCode 10.2 and Mac OS 10.14.4.Some more context and ugly work around. This is a swift server app and I'm using swift package manager to generate the xcode project. The following works and avoids the above errors, but it is a hassle.swift package generate-xcodeprojopen projName.xcodeprojbuild and runclick Debug Memory Graph button. App Stopped and Memory Graph displays fine. If I stop the app and run again then I get the above errors.stop the appchange the target name in Package.swiftswift package generate-xcodeprojopen projName.xcodeprojbuild and runMemory Graph works one time againrinse and repeatI've found that using Inspector exhibits the same behavior.Any help would be appreciated.Thanks,Dana
1
2
2.8k
Mar ’23
xctrace/instruments has big delay caused by dyld notifymonitor
Hello, While using the App Launch template with xctrace, the launch time for my app is much longer than expected. While investigating, I saw 4 syscalls to mach_msg_trap from dyld that are causing a delay of 100-300ms: I would like to know if there's any way to improve the performance here, as this is adding around 1 second more to my measurements and I have been trying to find a solution. Thank you very much for your help!
0
0
744
Mar ’23
Xctrace issue in M1 processor
Hi I am getting the below error while doing memory profiling(launching instruments using xctrace command) in M1 processor. Run issues were detected (trace is still ready to be viewed): [Error] Failed to start the recording: ktrace cannot trace the system under Rosetta translation [Error] Unexpected failure: Data source agent failed to arm. [Error] Unexpected failure: Couriers have returned unexpectedly. Recording failed with errors. Saving output file... I am launching below command via jenkins: xcrun xctrace record --template 'Leaks' --launch <app_name> --output 'recording.trace'.
3
0
2.2k
Mar ’23
Instruments Time Profiler does not show time at the C source code level
MacOS 12.3.1 Xcode 13.3.1 When I run my executable under Instruments with the Time Profiler it shows the time per function but when I click on the function name to see the time per line of code it displays the source but with no time information (percentage of time for that line). I've tried a variety of compiler options for my code such as -g and -g3 but that does not seem to matter. I have not used Instruments in a few years but I am pretty sure it displayed the time at the source code level with no special compiler flags in the past. Are special compiler flags needed to see the time per line of C source code? If not, how can I debug this? Thanks
4
1
2.9k
Feb ’23
How to symbolicate .xchanglog traces locally for hangs reported via xcode organiser
Hello, I am trying to analyse the hang logs stacktrace which are reported via xcode organiser for my app. The json .xchanglog files which are generated are not symbolicated. I was trying out the the recommendations which are used to symbolicate .crash logs but it did not work for me. Is there an apple recommendation on how we can symbolicate/analyse .xchanglog logs locally? Note: I have dSYM files available on my mac. The uuid are matched. Command i am using is replacing the correct values: % atos -arch BinaryArchitecture -o PathToDSYMFile/Contents/Resources/DWARF/BinaryName -l LoadAddress AddressesToSymbolicate Things tried: https://developer.apple.com/documentation/xcode/interpreting-the-json-format-of-a-crash-report https://developer.apple.com/documentation/xcode/adding-identifiable-symbol-names-to-a-crash-report Thanks!
0
0
1.4k
Feb ’23
16GB memory limit for iPad apps running on Apple Silicon Macs
I seem to be hitting a 16GB memory limit for my iPadOS app running under macOS on Apple Silicon. I can't find this limit documented or discussed anywhere else, so I'm posting here in the hopes of getting confirmation that it's official (as opposed to coincidental) and seeing if there's a way to lift or remove this limit. Background I have an iOS / iPadOS app that uses concurrency to solve puzzles. I have a Torture Test Puzzle that I use to stress-test the app. The Torture Test Puzzle results in millions of NSBlockOperations on a NSOperationQueue with a concurrency limit of ProcessInfo.processInfo.activeProcessorCount - 1 The app also uses Swift "copy on write" semantics to give each operation its own variation of the game model struct, so there are corresponding Swift.***Storage objects as well. Each of these objects is small (272 bytes for the block operations) but collectively, they add up to several GB. During a successful run, the peak memory usage of the app exceeds 50GB, as measured by Instruments and macOS Activity Monitor. When running the iPad app on the Apple Silicon Mac, it receives a memory warning (AppDelegate.applicationDidReceiveMemoryWarning) when usage hits 16GB. The app normally halts the solver and displays an error when that happens, but if I disable the watchdog, it crashes just as it would on a real iPad. Where it works and doesn't The app does not run out of memory when I build for Mac Catalyst or the Xcode Simulator: Hardware  Xcode Simulator   Mac Catalyst   "Designed for iPad"  2018 Mac mini, Core i3, 64GB RAM   ✓   ✓   (n/a)  2023 MacBook Pro, M2, 96GB RAM   ✓   ✓   ❌ Note: the choice of simulator is irrelevant. Even an iPod touch simulator runs to completion. What does the kernel say? In both the Catalyst and Simulator scenarios, os_proc_available_memory() reports 0 which I assume means "no limit." Whereas, under "Designed for iPad" it reports 17164220800 i.e. 16GB. So I assume this is a deliberate limit… I just see no documentation around it. What I've tried Increased Memory Limit I've tried adding the com.apple.developer.kernel.increased-memory-limit entitlement to the app. No change. — I've verified that the entitlement shows up in Xcode under Signing & Capabilities. — I've verified that the entitlement shows up in my developer account under Certificates, Identifiers & Profiles. — I've tried Quinn's trick of adding the additional Private VPN entitlement to the Mac build just to make sure Xcode picks it up. Extended Virtual Addressing I've tried adding the com.apple.developer.kernel.extended-virtual-addressing entitlement to the app. Made it worse. The app now runs out of memory at ~3.2GB. Note I don't see a forum tag specifically for questions related to "Designed for iPad apps running on Apple Silicon Macs," but please educate me if I missed one.
2
1
3.4k
Feb ’23
What's the difference between 'Profile' and 'Total PMC Aggregation'?
After logging trace for 'CPU Counters' template, we can see two views (Profile and Total PMC Aggregation) from detail area. We got some different data from these two views. For example: Samples: 'Total PMC Aggregation' has more samples than 'Profile' Process: We can see more process from 'Total PMC Aggregation' than 'Profile'. For example, Unknown(0) is shown on 'Total PMC Aggregation' but not on 'Profile'. Other than above, the same counter value between these two views are also different. Can anyone guide us what's the difference and why? Thanks.
0
1
781
Jan ’23
Strategies for minimizing OOM crashes?
Hello, We are facing many memory related crashes. Right now this is our top crash reason and after reading through many other useful posts in the forums, such as "how Xcode to calculate Memory" where @eskimo provided lots of useful info, and talks such as iOS Memory Deep Dive I figured out it was time to post a new thread to see if anyone can help. Our crashes generally happen when drawing a PDF (using PDFKit's draw(with:to:)), although they also happen in other places where memory is needed such as Array.insert (which ends up calling swift_slowAlloc and swift_slowAlloc.cold), or std::bad_alloc. The exceptions are either EXC_BREAKPOINT on CFRetain, NSMallocException (Failed to grow buffer), or the previously mentioned std:bad_alloc. In addition to this, we have many other OOM that are not tracked by our crash reporting tool. For crashes that are reported, the average free RAM our users have ranges from 30 MB to 120 MB. In other cases the user seems to have 400 MB of free RAM or even more. I have a few questions around this that I hope are also useful for other folks. Besides general recommendations of using less memory in general, what's the recommended approach for minimizing these memory issues? Most of our disposable memory is in held in NSCaches (with reasonable total cost limits and properly calculated cost per object). On this case, is it recommended to handle the NSMallocExceptions, try to free memory, and retry the operation? As mentioned, in many cases we don't even get memory warnings prior to the crashes. I'm wondering if memory fragmentation is also affecting us, but I don't think there's much we can do about this. I noticed PDFKit requesting allocations as large as 30 MB to render a 100x100 thumbnail (when I simulated a situation where I ran out of VM, I caught that with the ASAN, which reports the memory that was attempted to be allocated). Another alternative I could think of is to try to use os_proc_available_memory() and try to free some memory if memory is low. The reasoning behind this is that since we have no way to know how much memory the operation it's going to use, but we have data of free memory of users with crashes, we could try to free up memory to be above that. I'm not sure how effective would that be though. As some of these users seem to have enough RAM, they might be running out of virtual memory. What's the best way to track Virtual Memory, to use it as a hint in our crash reports? Reading the virtual_size from task_vm_info in my iPad returns over 400 GB. I was expecting this to be the virtual used size, like the size that gets reported on the VM Tracker instrument. I mention this because I was able to reproduce these crashes by memory mapping ~50 GB of a 200 MB file in a 2017 iPad Pro, and then doing other unrelated memory operations. For apps that are document based, with arbitrary-sized documents, is it recommended to ask for the extended virtual addressing entitlement and the increased memory limit one? Could these help on lower end devices? Would listening to memory pressure events help at all? There's a .warning and .critical memory pressure events. I'm wondering wether the system wide warnings only are sent when the memory pressure is critical, although it doesn't look like it looking at the names of the constants. If I'm using NSCache, is it safe (memory compression wise) to empty the cache under some circumstances? Put it in a different way: does emptying an NSCache causes the memory compressor to decompress the data? Are there any other recommendations or things that I might have missed? Thanks a lot in advance!
0
1
2.3k
Dec ’22
XCode 14 & Firebase Crashlytics
I have not been able to find much chatter at all about the impact of not having dsym files via TestFlight to support Crashlytics reporting. Currently, I download the files from TestFlight and then upload them to Firebase. Then, a Slack integration is used to notify me when there is a new crash that needs to be investigated. Does the new change to XCode 14 basically remove Crashlytics from equation? Since I rely on Apple to sign the apps, I'm assuming that nothing local can be used. But, I'm also "still learning". Any insights/suggestions are appreciated.
7
0
7.1k
Dec ’22
xctrace does not collect any data and stuck infinitly
➜ ~ xcrun xctrace record --template 'App Launch' --device 'xxxxxx' --output ~/Downloads/test.trace --launch 'yyyyy.app' Waiting for device to boot Starting recording with the App Launch template. Launching process: NOW研发版.app.  Ctrl-C to stop the recording Reached specified time limit, ending recording... xctrace could not ending recording in 30 minutes, it seems it will not ending at all.
1
0
920
Dec ’22
Embedding existing lane/track in custom Instrument
I have a custom Instrument that is generally paired with Apple's HTTP Traffic instrument. Combining them in a template is inconvenient because there is no way to automatically filter to just the URLSession I want. The user must drill down into a long list of sessions and servers every time the instrument is run. The layout is also awkward because my Instrument's output is a long way from the specific HTTP track I want. Pinning these specific tracks is good, but has to be done every time and cannot be saved as a template. I would like to extract the relevant information directly into my custom instrument, so just the information I want is visible, and in an order that is useful. I can import the data from HTTPTracing and build my own tables, but is there a way to import the plot itself and reuse it? I would rather not have to re-implement Apple's fairly complex plot. If not, is there a way to access Apple's code for the HTTPTracing plots so that I can add it in my own instrument?
0
0
1.2k
Nov ’22
In custom Instrument, how can I include the duration in a value
I have a custom Instrument with a os-signpost-interval-schema that captures a "state" string. I would like the final plot value to be <state>: <duration>, but I don't know how to get the duration into the string. My working schema is the following, which just stores the state itself in the column: <os-signpost-interval-schema> <id>state-interval</id> <title>State Interval</title> <subsystem>"..."</subsystem> <category>"..."</category> <name>"state"</name> <start-pattern> <message>?state</message> </start-pattern> <column> <mnemonic>state</mnemonic> <title>State</title> <type>string</type> <expression>?state</expression> </column> </os-signpost-interval-schema> I would like to change the expression in the column to (str-cat ?state ": " ?duration), but that fails with: Variable '?duration' must appear in a pattern element to be used in a later expression. I don't see any way to compute this later in the graph, lane, or plot. I've also tried explicitly creating a <duration-column>, but that doesn't seem to change anything. The rest of the pieces include the table: <create-table> <id>state-table</id> <schema-ref>state-interval</schema-ref> </create-table> And the lane, which I would like to display as <state>: <duration> rather than just the duration: <lane> <title>State</title> <table-ref>state-table</table-ref> <plot> <value-from>state</value-from> </plot> </lane>
1
1
1.3k
Nov ’22
Activity Monitor and Instruments show different memory usage
While doing some persistent testing against our product (the target is a system extension), we noticed huge memory usage (1Gig+) reported by the Activity Monitor. However when we sat down to actually profile the memory usage, we noticed Intruments tool only reported ~200MB overall usage against the same process (same PID). These 2 numbers were observed at the same time. We knew that our system extension had processed some intense events during the persistent testing and its heap usage peaked at around 800 or perhaps 900MB at a time in the memory profiling; But since at the end of profiling the heap usage dropped to ~200MB I'd say we are good (we trust the Instruments result mostly). However how do we explain the fact Activity Monitor still reported the 1Gig usage (and I knew there were also confusion around the "real memory" or "private memory" stuff, the "1Gig" number referred here was from the "Memory" column from Activity Monitor)? Mostly, our concern is that since the Activity Monitor is an end user facing utility, they'd potentially look at the big number and come back complaining about our memory usage. If this happens is it ok for us to explain that the actual memory usage by our program is less than what Activity Monitor shows?
0
0
1.5k
Nov ’22
Instruments App Launch: What's being initialized in Static Initializer
I'd like to know if there's a way to determine what's being initialized in the Static Initializer Calls Section of the App Launch Template in Instruments. I see large blocks of stuff being initialized but it only gives me a hex reference, I'd like to know exactly what's the problem (what's being initialized) so I can move it elsewhere.
1
0
1.3k
Nov ’22
Media Stream Validator on iPad(9th generation)
Hello, i want to make some tests with the Media Stream Validator (present on HTTP Live Streaming Tools), i have read already a few times that is not possible since it's a .dmg file. Can you please confirm if it's possible or not to have this tool on an iPad? if it's possible can you let me know if there is any documentation or some extra steps to do? Thank you in advance! Regards.
1
0
715
Oct ’22
Find Unused code and variables
How can I find unused code and any other unused objects? I want to use Xcode
Replies
1
Boosts
0
Views
5.2k
Activity
Mar ’23
Memory Graph - Unable to acquire required task port
I'm trying to find memory leaks in my application with either Memory Graph or Inspector. I'm getting the following errors:Memory Graph - Unable to acquire required task portInspector Prompts for passwordError: Failed to attach to target processAn error occurred trying to capture Leaks data.Unable to acquire required task port ()The odd thing is that both work on initial execution of the target, but every subsequent launch triggers the above errors. (including after restarting xcode and after reboot).If I change my target name it works one time and then the errors start again. So the target name is being cached somewhere and causing subsequent testing with that name impossible.I'm running xCode 10.2 and Mac OS 10.14.4.Some more context and ugly work around. This is a swift server app and I'm using swift package manager to generate the xcode project. The following works and avoids the above errors, but it is a hassle.swift package generate-xcodeprojopen projName.xcodeprojbuild and runclick Debug Memory Graph button. App Stopped and Memory Graph displays fine. If I stop the app and run again then I get the above errors.stop the appchange the target name in Package.swiftswift package generate-xcodeprojopen projName.xcodeprojbuild and runMemory Graph works one time againrinse and repeatI've found that using Inspector exhibits the same behavior.Any help would be appreciated.Thanks,Dana
Replies
1
Boosts
2
Views
2.8k
Activity
Mar ’23
xctrace/instruments has big delay caused by dyld notifymonitor
Hello, While using the App Launch template with xctrace, the launch time for my app is much longer than expected. While investigating, I saw 4 syscalls to mach_msg_trap from dyld that are causing a delay of 100-300ms: I would like to know if there's any way to improve the performance here, as this is adding around 1 second more to my measurements and I have been trying to find a solution. Thank you very much for your help!
Replies
0
Boosts
0
Views
744
Activity
Mar ’23
Xctrace issue in M1 processor
Hi I am getting the below error while doing memory profiling(launching instruments using xctrace command) in M1 processor. Run issues were detected (trace is still ready to be viewed): [Error] Failed to start the recording: ktrace cannot trace the system under Rosetta translation [Error] Unexpected failure: Data source agent failed to arm. [Error] Unexpected failure: Couriers have returned unexpectedly. Recording failed with errors. Saving output file... I am launching below command via jenkins: xcrun xctrace record --template 'Leaks' --launch <app_name> --output 'recording.trace'.
Replies
3
Boosts
0
Views
2.2k
Activity
Mar ’23
Instruments Time Profiler does not show time at the C source code level
MacOS 12.3.1 Xcode 13.3.1 When I run my executable under Instruments with the Time Profiler it shows the time per function but when I click on the function name to see the time per line of code it displays the source but with no time information (percentage of time for that line). I've tried a variety of compiler options for my code such as -g and -g3 but that does not seem to matter. I have not used Instruments in a few years but I am pretty sure it displayed the time at the source code level with no special compiler flags in the past. Are special compiler flags needed to see the time per line of C source code? If not, how can I debug this? Thanks
Replies
4
Boosts
1
Views
2.9k
Activity
Feb ’23
How to symbolicate .xchanglog traces locally for hangs reported via xcode organiser
Hello, I am trying to analyse the hang logs stacktrace which are reported via xcode organiser for my app. The json .xchanglog files which are generated are not symbolicated. I was trying out the the recommendations which are used to symbolicate .crash logs but it did not work for me. Is there an apple recommendation on how we can symbolicate/analyse .xchanglog logs locally? Note: I have dSYM files available on my mac. The uuid are matched. Command i am using is replacing the correct values: % atos -arch BinaryArchitecture -o PathToDSYMFile/Contents/Resources/DWARF/BinaryName -l LoadAddress AddressesToSymbolicate Things tried: https://developer.apple.com/documentation/xcode/interpreting-the-json-format-of-a-crash-report https://developer.apple.com/documentation/xcode/adding-identifiable-symbol-names-to-a-crash-report Thanks!
Replies
0
Boosts
0
Views
1.4k
Activity
Feb ’23
16GB memory limit for iPad apps running on Apple Silicon Macs
I seem to be hitting a 16GB memory limit for my iPadOS app running under macOS on Apple Silicon. I can't find this limit documented or discussed anywhere else, so I'm posting here in the hopes of getting confirmation that it's official (as opposed to coincidental) and seeing if there's a way to lift or remove this limit. Background I have an iOS / iPadOS app that uses concurrency to solve puzzles. I have a Torture Test Puzzle that I use to stress-test the app. The Torture Test Puzzle results in millions of NSBlockOperations on a NSOperationQueue with a concurrency limit of ProcessInfo.processInfo.activeProcessorCount - 1 The app also uses Swift "copy on write" semantics to give each operation its own variation of the game model struct, so there are corresponding Swift.***Storage objects as well. Each of these objects is small (272 bytes for the block operations) but collectively, they add up to several GB. During a successful run, the peak memory usage of the app exceeds 50GB, as measured by Instruments and macOS Activity Monitor. When running the iPad app on the Apple Silicon Mac, it receives a memory warning (AppDelegate.applicationDidReceiveMemoryWarning) when usage hits 16GB. The app normally halts the solver and displays an error when that happens, but if I disable the watchdog, it crashes just as it would on a real iPad. Where it works and doesn't The app does not run out of memory when I build for Mac Catalyst or the Xcode Simulator: Hardware  Xcode Simulator   Mac Catalyst   "Designed for iPad"  2018 Mac mini, Core i3, 64GB RAM   ✓   ✓   (n/a)  2023 MacBook Pro, M2, 96GB RAM   ✓   ✓   ❌ Note: the choice of simulator is irrelevant. Even an iPod touch simulator runs to completion. What does the kernel say? In both the Catalyst and Simulator scenarios, os_proc_available_memory() reports 0 which I assume means "no limit." Whereas, under "Designed for iPad" it reports 17164220800 i.e. 16GB. So I assume this is a deliberate limit… I just see no documentation around it. What I've tried Increased Memory Limit I've tried adding the com.apple.developer.kernel.increased-memory-limit entitlement to the app. No change. — I've verified that the entitlement shows up in Xcode under Signing & Capabilities. — I've verified that the entitlement shows up in my developer account under Certificates, Identifiers & Profiles. — I've tried Quinn's trick of adding the additional Private VPN entitlement to the Mac build just to make sure Xcode picks it up. Extended Virtual Addressing I've tried adding the com.apple.developer.kernel.extended-virtual-addressing entitlement to the app. Made it worse. The app now runs out of memory at ~3.2GB. Note I don't see a forum tag specifically for questions related to "Designed for iPad apps running on Apple Silicon Macs," but please educate me if I missed one.
Replies
2
Boosts
1
Views
3.4k
Activity
Feb ’23
What's the difference between 'Profile' and 'Total PMC Aggregation'?
After logging trace for 'CPU Counters' template, we can see two views (Profile and Total PMC Aggregation) from detail area. We got some different data from these two views. For example: Samples: 'Total PMC Aggregation' has more samples than 'Profile' Process: We can see more process from 'Total PMC Aggregation' than 'Profile'. For example, Unknown(0) is shown on 'Total PMC Aggregation' but not on 'Profile'. Other than above, the same counter value between these two views are also different. Can anyone guide us what's the difference and why? Thanks.
Replies
0
Boosts
1
Views
781
Activity
Jan ’23
Xcode Instruments "App Launch". App Life Cycle timeline not shown
I watched WWDC 2019 - Session 423 - Optimizing App Launch and read documentation page "Reducing Your App's Launch Time" so I want to see my application launch metrics along with App Life Cycle timeline but I can't see it.Steps:- Launch Profile on simulator- Select App Launch- Wait...I can see metrics but not App Life Cycle timeline.
Replies
2
Boosts
1
Views
4.6k
Activity
Jan ’23
FREE TRIALS IF I GOT MY MAC
Hi guys I recently bought a new macbook air and i was wondering what free trials do i have with this purchase
Replies
0
Boosts
0
Views
702
Activity
Jan ’23
Strategies for minimizing OOM crashes?
Hello, We are facing many memory related crashes. Right now this is our top crash reason and after reading through many other useful posts in the forums, such as "how Xcode to calculate Memory" where @eskimo provided lots of useful info, and talks such as iOS Memory Deep Dive I figured out it was time to post a new thread to see if anyone can help. Our crashes generally happen when drawing a PDF (using PDFKit's draw(with:to:)), although they also happen in other places where memory is needed such as Array.insert (which ends up calling swift_slowAlloc and swift_slowAlloc.cold), or std::bad_alloc. The exceptions are either EXC_BREAKPOINT on CFRetain, NSMallocException (Failed to grow buffer), or the previously mentioned std:bad_alloc. In addition to this, we have many other OOM that are not tracked by our crash reporting tool. For crashes that are reported, the average free RAM our users have ranges from 30 MB to 120 MB. In other cases the user seems to have 400 MB of free RAM or even more. I have a few questions around this that I hope are also useful for other folks. Besides general recommendations of using less memory in general, what's the recommended approach for minimizing these memory issues? Most of our disposable memory is in held in NSCaches (with reasonable total cost limits and properly calculated cost per object). On this case, is it recommended to handle the NSMallocExceptions, try to free memory, and retry the operation? As mentioned, in many cases we don't even get memory warnings prior to the crashes. I'm wondering if memory fragmentation is also affecting us, but I don't think there's much we can do about this. I noticed PDFKit requesting allocations as large as 30 MB to render a 100x100 thumbnail (when I simulated a situation where I ran out of VM, I caught that with the ASAN, which reports the memory that was attempted to be allocated). Another alternative I could think of is to try to use os_proc_available_memory() and try to free some memory if memory is low. The reasoning behind this is that since we have no way to know how much memory the operation it's going to use, but we have data of free memory of users with crashes, we could try to free up memory to be above that. I'm not sure how effective would that be though. As some of these users seem to have enough RAM, they might be running out of virtual memory. What's the best way to track Virtual Memory, to use it as a hint in our crash reports? Reading the virtual_size from task_vm_info in my iPad returns over 400 GB. I was expecting this to be the virtual used size, like the size that gets reported on the VM Tracker instrument. I mention this because I was able to reproduce these crashes by memory mapping ~50 GB of a 200 MB file in a 2017 iPad Pro, and then doing other unrelated memory operations. For apps that are document based, with arbitrary-sized documents, is it recommended to ask for the extended virtual addressing entitlement and the increased memory limit one? Could these help on lower end devices? Would listening to memory pressure events help at all? There's a .warning and .critical memory pressure events. I'm wondering wether the system wide warnings only are sent when the memory pressure is critical, although it doesn't look like it looking at the names of the constants. If I'm using NSCache, is it safe (memory compression wise) to empty the cache under some circumstances? Put it in a different way: does emptying an NSCache causes the memory compressor to decompress the data? Are there any other recommendations or things that I might have missed? Thanks a lot in advance!
Replies
0
Boosts
1
Views
2.3k
Activity
Dec ’22
XCode 14 & Firebase Crashlytics
I have not been able to find much chatter at all about the impact of not having dsym files via TestFlight to support Crashlytics reporting. Currently, I download the files from TestFlight and then upload them to Firebase. Then, a Slack integration is used to notify me when there is a new crash that needs to be investigated. Does the new change to XCode 14 basically remove Crashlytics from equation? Since I rely on Apple to sign the apps, I'm assuming that nothing local can be used. But, I'm also "still learning". Any insights/suggestions are appreciated.
Replies
7
Boosts
0
Views
7.1k
Activity
Dec ’22
xctrace does not collect any data and stuck infinitly
➜ ~ xcrun xctrace record --template 'App Launch' --device 'xxxxxx' --output ~/Downloads/test.trace --launch 'yyyyy.app' Waiting for device to boot Starting recording with the App Launch template. Launching process: NOW研发版.app.  Ctrl-C to stop the recording Reached specified time limit, ending recording... xctrace could not ending recording in 30 minutes, it seems it will not ending at all.
Replies
1
Boosts
0
Views
920
Activity
Dec ’22
Hitches duration 37s,how find my problem
Hitches duration is 37s. Hitches type is "delay frame swap". Render do noting. GPU do noting. Main Thread is ok,touch screen can print,but the frame not update.
Replies
1
Boosts
2
Views
1.7k
Activity
Nov ’22
Embedding existing lane/track in custom Instrument
I have a custom Instrument that is generally paired with Apple's HTTP Traffic instrument. Combining them in a template is inconvenient because there is no way to automatically filter to just the URLSession I want. The user must drill down into a long list of sessions and servers every time the instrument is run. The layout is also awkward because my Instrument's output is a long way from the specific HTTP track I want. Pinning these specific tracks is good, but has to be done every time and cannot be saved as a template. I would like to extract the relevant information directly into my custom instrument, so just the information I want is visible, and in an order that is useful. I can import the data from HTTPTracing and build my own tables, but is there a way to import the plot itself and reuse it? I would rather not have to re-implement Apple's fairly complex plot. If not, is there a way to access Apple's code for the HTTPTracing plots so that I can add it in my own instrument?
Replies
0
Boosts
0
Views
1.2k
Activity
Nov ’22
In custom Instrument, how can I include the duration in a value
I have a custom Instrument with a os-signpost-interval-schema that captures a "state" string. I would like the final plot value to be <state>: <duration>, but I don't know how to get the duration into the string. My working schema is the following, which just stores the state itself in the column: <os-signpost-interval-schema> <id>state-interval</id> <title>State Interval</title> <subsystem>"..."</subsystem> <category>"..."</category> <name>"state"</name> <start-pattern> <message>?state</message> </start-pattern> <column> <mnemonic>state</mnemonic> <title>State</title> <type>string</type> <expression>?state</expression> </column> </os-signpost-interval-schema> I would like to change the expression in the column to (str-cat ?state ": " ?duration), but that fails with: Variable '?duration' must appear in a pattern element to be used in a later expression. I don't see any way to compute this later in the graph, lane, or plot. I've also tried explicitly creating a <duration-column>, but that doesn't seem to change anything. The rest of the pieces include the table: <create-table> <id>state-table</id> <schema-ref>state-interval</schema-ref> </create-table> And the lane, which I would like to display as <state>: <duration> rather than just the duration: <lane> <title>State</title> <table-ref>state-table</table-ref> <plot> <value-from>state</value-from> </plot> </lane>
Replies
1
Boosts
1
Views
1.3k
Activity
Nov ’22
Activity Monitor and Instruments show different memory usage
While doing some persistent testing against our product (the target is a system extension), we noticed huge memory usage (1Gig+) reported by the Activity Monitor. However when we sat down to actually profile the memory usage, we noticed Intruments tool only reported ~200MB overall usage against the same process (same PID). These 2 numbers were observed at the same time. We knew that our system extension had processed some intense events during the persistent testing and its heap usage peaked at around 800 or perhaps 900MB at a time in the memory profiling; But since at the end of profiling the heap usage dropped to ~200MB I'd say we are good (we trust the Instruments result mostly). However how do we explain the fact Activity Monitor still reported the 1Gig usage (and I knew there were also confusion around the "real memory" or "private memory" stuff, the "1Gig" number referred here was from the "Memory" column from Activity Monitor)? Mostly, our concern is that since the Activity Monitor is an end user facing utility, they'd potentially look at the big number and come back complaining about our memory usage. If this happens is it ok for us to explain that the actual memory usage by our program is less than what Activity Monitor shows?
Replies
0
Boosts
0
Views
1.5k
Activity
Nov ’22
Instruments App Launch: What's being initialized in Static Initializer
I'd like to know if there's a way to determine what's being initialized in the Static Initializer Calls Section of the App Launch Template in Instruments. I see large blocks of stuff being initialized but it only gives me a hex reference, I'd like to know exactly what's the problem (what's being initialized) so I can move it elsewhere.
Replies
1
Boosts
0
Views
1.3k
Activity
Nov ’22
Media Stream Validator on iPad(9th generation)
Hello, i want to make some tests with the Media Stream Validator (present on HTTP Live Streaming Tools), i have read already a few times that is not possible since it's a .dmg file. Can you please confirm if it's possible or not to have this tool on an iPad? if it's possible can you let me know if there is any documentation or some extra steps to do? Thank you in advance! Regards.
Replies
1
Boosts
0
Views
715
Activity
Oct ’22
How to get the cpu frequency for iPhone
I want to monitoring the realtime cpu frequency while debuging my application, Is there any way to get the ios cpu frequency?
Replies
0
Boosts
0
Views
1.3k
Activity
Oct ’22