We are getting crash issue in our WKWebkit based Cordova application due to memory issues. However, for debugging the memory issue we are trying to use JavaScript allocations in the memory profiler of instruments. and while using it, the profiler automatically closes within few seconds, and we are not able to debug the underlaying memory issue in the WKWebKit. I
Instruments
RSS for tagInstruments is a performance-analysis and testing tool for iOS, iPadOS, watchOS, tvOS, and macOS apps.
Posts under Instruments tag
80 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I saved a trace from the Leaks tool. However when I try to open the saved file, I get an error that says, "The document 'Generations.trace' could not be opened. Trace is malformed - run data is missing." This happens every time I try to save from Instruments.
I'm using Instruments 15.3. Any ideas?
We're planning to integrate performance profiling tool into our own Application.
The standard tool is Xcode Instruments, which is great but requires Xcode to be installed.
I have couple of queries related to that.
Is there a way to use Instruments without clients needing to install Xcode?
If not, then can we include Xcode installation as part of my application installation in the customer machine?
I'm currently supporting an app where one of the dependencies we use had an update. The app is an iPad only app that is meant to be run as a kiosk (guided access, single app mode). After the dependency update for the casing of the tablet / kiosk, we noticed an uptick in errors that may or may not have been associated with the recent 3rd party software update.
I wanted to verify if the update had an impact on our production kiosks. To get a good idea of whether or not the update for casework's library had a negative impact, though, I would need to run instruments on a tablet while it's in the case. There's only one power cable to the iPad and the cable that would be used to connect directly to a Mac / Xcode is the same cable that connects to the casework.
Is it possible to run instruments, and then retrieve data, from an app that's not directly connected to Xcode? Or is it possible for Xcode to somehow connect via a running instance of an app remotely?
I have the Vision Pro developer strap, do I need to do anything to make Instruments transfer the data over it rather than wifi? Or will it do that automatically?
It seems incredibly slow for transferring and then analysing data.
I can see the Vision Pro recognised in Configurator, so assume it's working.
Otherwise.. Any tips for speeding up Instruments? Capturing 5 mins of gameplay (high-freq) then takes 30-40+ mins to appear in Instruments on an M2 Max 32gb.
Thanks!
When I run my app in debug mode, whenever a time consuming task is run (like a core data fetch request) there is a time indication appearing on top of the view. I am unable to find the meaning of this and how it is named.
It looks like:
"appName NNNN ms"
(it is not caught by the screen shot)
Can someone tell if it is possible to get rid of it and how ? Thanks for your help !
I ran it (Leaks) on a process for about 2 hours. It collected 68gytes of data. It cannot open the folder -- can't find a file (which is there as a .zip archive) or if I expand it, just an error about missing an index.
Filing a bug about this is difficult, since it's 68gbyets of data.
I'm on VisionOS 1.2 beta and Instruments will capture everything but RealityKit information.
RealityKit frames and RealityKit metrics captures no data. This used to work though I'm not sure what version it did. Unbelievably frustrating.
I was watching https://developer.apple.com/videos/play/wwdc2023/10248/ , in this video it is adviced to make below shated property async to benefit from concurency (in video 40:04 , exact time) , do yo know how to do it ?
class ColorizingService {
static let shared = ColorizingService()
func colorize(_ grayscaleImage: CGImage) async throws -> CGImage
// [...]
}
struct ImageTile: View {
// [...]
// implicit @MainActor
var body: some View {
mainContent
.task() { // inherits @MainActor isolation
// [...]
result = try await ColorizingService.shared.colorize(image)
}
}
}
Hello, technical friends, I am developing a custom keyboard extension, currently encountered a technical difficulty, almost asked AI and Google have not solved my problem.
Problem description:
When my App was first installed, I opened Settings from the App, enabled full access, and crashed when I returned to the App. Run the App for the second time, open the Settings from the App, update the full access permission, and automatically re-run the App after returning to the App, and then the third, fourth, and NTH times will not crash.
Seems like ios will kill host apps for custom keyboard extensions after full access is updated?
I want my App installed for the first time to update full access to return App without crashing, but don't know how to fix this problem. I look forward to the technical experts working in Apple development to help me provide relevant technical methods and ideas so that I can solve this problem. Thank you very much!
When tracing debugging in xcode, after the App forces exit, the console prompts:
Message from debugger: Terminated due to signal 9
When I was monitoring CPU and memory usage, it was very low and I didn't see anything unusual.
Users have reported unusually high data usage with my app.
So to investigate I have profiled in instruments. My app as expected in using minimal data. However in instruments I see an "Unknown" process. Which sends around 1mb of data every 2 seconds.
Can anyone explain what unknown process is? Sorry my question is vague but I'm at the beginning of understanding the instruments outputs so your help is so very much appreciated.
Hi! I allready have started a product page optimization tests in the past, but now I want to test different versions of my icon.
But I can't see the option to change the icons, how can I do that?
Hi,
I am using xctrace to launch an app and check if the app launched successfully or crashed by reading the content of the .trace file. However if multiple devices are connected , xctrace complain No devices found matching the identifier specified. Please let me know if there is any limitations for the device to be connected.
・Xcode 15.1
・The app is also compatible with Watch.
In the privacy manifest, we defined NSPrivacyTracking to YES and NSPrivacyTrackingDomains to specific domains.
Furthermore, to avoid warnings when uploading to Testflight,
we have implemented a privacy manifest file in the app with the following configuration.
・Place the .xcprivacy files for the app itself and WatchExtension under their respective Target directories.
・Settings related to tracking domains are listed in .xcprivacy of the app itself.
・In .xcprivacy of WatchExtension, only describe the reason for UserDefault of NSPrivacyAccessedAPIType
However, these implementations do not block network connections,
"Fault" still occurs on "Point of Intereset instruments".
Is there something wrong with my implementation?
Hi!
I watched WWDC 2019 Optimizing App Launch video and can't see the Lifecycle phases when I Profile my App.
I'm using Xcode 15.2 with Instruments 15.2, and SwiftUI as UI framework.
Here is a screenshot of what I get.
It's there another tool or another way to get this information?
Thanks!
Alfonso.
I am trying to profile my app for 'Data Persistence', but I am not getting any data in the Instruments. I tried restarting Xcode and Mac, still no progress. It is showing blank graph for faults, fetches and saves
I asked this on StackOverflow too, but did not get a response. Copying verbatim (images might not work as expected).
Short question: which instructions other than floating point arithmetic instructions like fmul, fadd, fdiv etc are counted under the hardware event INST_SIMD_ALU in XCode Instruments? Alternatively, how can I count the number of floating point operations in a program using CPU counters?
I want to measure/estimate the FLOPs count of my program and thought that CPU counters might be a good tool for this. The closest hardware event mnemonic that I could find is INST_SIMD_ALU, whose description reads.
Retired non-load/store Advanced SIMD and FP unit instructions
So, as a sanity check I wrote a tiny Swift code with ostensibly predictable FLOPs count.
let iterCount = 1_000_000_000
var x = 3.1415926
let a = 2.3e1
let ainv = 1 / a // avoid inf
for _ in 1...iterCount {
x *= a
x += 1.0
x -= 6.1
x *= ainv
}
So, I expect there to be around 4 * iterCount = 4e9 FLOPs. But, on running this under CPU Counters with the event INST_SIMD_ALU I get a count of 5e9, 1 extra FLOP per loop iteration than expected. See screenshot below. dumbLoop is the name of the function that I wrapped the code in.
Here is the assembly for the loop
+0x3c fmul d0, d0, d1 <----------------------------------
+0x40 fadd d0, d0, d2 |
+0x44 fmov d4, x10 |
+0x48 fadd d0, d0, d4 |
+0x4c fmul d0, d0, d3 |
+0x50 subs x9, x9, #0x1 |
+0x54 b.ne "specialized dumbLoop(_:initialValue:)+0x3c" ---
Since it's non-load/store instructions, it shouldn't be counting fmov and b.ne. That leaves subs, which is an integer subtraction instruction used for decrementing the loop counter. So, I ran two more "tests" to see if the one extra count comes from subs.
On running it again with CPU Counters with the hardware event INST_INT_ALU, I found a count of one billion, which adds up with the number of loop decrements.
Just to be sure, I unrolled the loop by a factor of 4, so that the number of loop decrements becomes 250 million from one billion.
let iterCount = 1_000_000_000
var x = 3.1415926
let a = 2.3e1
let ainv = 1 / a // avoid inf
let n = Int(iter_count / 4)
for _ in 1...n {
x *= a
x += 1.0
x -= 6.1
x *= ainv
x *= a
x += 1.0
x -= 6.1
x *= ainv
x *= a
x += 1.0
x -= 6.1
x *= ainv
x *= a
x += 1.0
x -= 6.1
x *= ainv
}
print(x)
And it adds up, around 250 million integer ALU instructions, and the total ALU instructions is 4.23 billion, somewhat short of the expected 4.25 billion.
So, at the moment if I want to count the FLOPs in my program, one estimate I can use is INST_SIMD_ALU - INST_INT_ALU. But, is this description complete, or are there an other instructions that I might spuriously count as floating point operations? Is there a better way to count the number of FLOPs?
I am interested in adding signposts to an existing large application that was written in .NET compiled in VisualStudio for MacOS so that I can isolate portions of the application in instruments. It seems like it's straightforward to do this in C++ but I couldn't figure out how to do it, perhaps there is a way via dll invoke? Appreciate any suggestions.
Hello everyone,
Our iOS app is taking too long to launch. On checking the launch profile, we are seeing that most of the launch time is being spent in applying fixups which is taking more than a second and at times even more to complete.
Our deployment target is iOS 15+. We have checked using dyld_info that our binary uses chained fixups. Since chained fixups are enabled, page-in linking should also be enabled for our app as per this WWDC session.
Can someone please help us understand why the fixups application is taking this long and how can we improve it?
Thanks.
As title, i tried to get tracking domain by Network instruments,
but it shows Call os_log APIs on a logging handle network instruments.
Anyone know how can i log the domain. Thanks