My website is using a lot of memory. JavaScript Allocations Timeline shows that js occupies 130MB. However, instruments show that the overall memory usage of webview reaches 480MB. I would like to know if there is any tool to analyze the distribution of this 480MB of memory usage.
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
Hello there, I try to add universal links to my app but get some problems. When I started researching how I can test it I found a lot of talks about App Search API Validation Tool. But this service is not open for me, I'm always redirected to the home page. Is there something wrong with me or is this service not working at all?
Hi,
I want to delete an application from my device using xcrun devicectl command. I installed application using xcrun devicectl and I want to be able to delete it when I need but I cannot find proper arguments for command.
Thank you!
Hi everyone,
I'm developing a visionOS app using SwiftUI and RealityKit, and I'm encountering an issue with the pivot points of primitive shapes created in Reality Composer Pro.
Scenario:
When I use Reality Composer Pro within Xcode to add primitive shapes (such as cubes, capsules, etc.) to my scene, the pivot points for these objects seem to be set incorrectly. The pivot is located far from the actual object, which affects transformations and positioning.
Question:
Is there a way to correct or adjust the pivot point for primitive shapes created in Reality Composer Pro?
Additional Information:
I’ve attached a screenshot illustrating the issue with the pivot point being misaligned. Any guidance on how to resolve this would be greatly appreciated.
Thanks in advance for your help!
Best,
Siddharth
Trying to examine performance issues in Xcode Instruments using the Animation Hitches instrument in Xcode 16.0 beta 6 (16A5230g).
When connected to my iPhone 15 Pro Max and I try to start a run with my app, it has an error “Failed to split user provided arguments: working directory doesn't exist” with timestamp “(Before Run Started)”. When running the app on an iOS simulator, the instrument runs fine—but I want to profile on a real device.
Instruments > Settings, Recording Location set to Default and that directory does exist.
We have an app that captures images and videos and we share them to a server. Now at initial state the app works fine, but as we start using the app, the memory grows and my app crashes finally. Kindly help in identifying how to rectify and remove the resident memory and dirty memory.
I'm writing software that uses the security framework to get signing information from applications. I noticed that over time memory consumption goes up. After checking with Instruments, I saw an accumulation of objects coming from the internals of the security framework. These allocated objects don't seem to go away.
Following is a standalone code sample that seems to cause the problem in my env. Running it by itself creates a big number of objects that are not released. I also attached a screenshot from Instruments.
#include <Foundation/Foundation.h>
#include <Security/Security.h>
#include <unistd.h>
OSStatus get_signing_info(const char* path)
{
SecStaticCodeRef codeRef = NULL;
OSStatus status;
NSString* str = [NSString stringWithUTF8String:path];
NSURL* url = [NSURL fileURLWithPath:str];
status = SecStaticCodeCreateWithPath((__bridge CFURLRef)url, kSecCSDefaultFlags, &codeRef);
CFDictionaryRef _info = NULL;
status = SecCodeCopySigningInformation(codeRef, kSecCSSigningInformation, &_info);
NSDictionary* info = (__bridge_transfer NSDictionary *)_info;
int flags = [[info objectForKey:(NSString *)kSecCodeInfoFlags] intValue];
NSLog(@"%d", flags);
CFRelease(codeRef);
return status;
}
int main(int argc, const char * argv[]) {
@autoreleasepool {
for (int i = 0; i < 1000; ++i) {
@autoreleasepool {
OSStatus status = get_signing_info(argv[1]);
NSLog(@"i=%d, status=%d", i, status);
}
}
sleep(100);
}
return 0;
}
Is there a way to get rid of these objects that clog up the memory? Or perhaps use the framework differently to avoid this issue?
Hello!
Is it possible to make App Thinning Size Report for app store distribution with command "xcodebuild -exportArchive -archivePath iOSApp.xcarchive -exportPath Release/MyApp -exportOptionsPlist ExportOptions.plist" ? https://developer.apple.com/documentation/xcode/reducing-your-app-s-size#Automate-the-generation-of-the-app-size-report
I tried to do this by specifying "method": "app-store" in ExportOptions.plist, but it doesn't work. I get an empty app-thinning.plist as output. But when I specify "method": "enterprise", it works correctly.
Is it true that App Thinning Size Reports are only generated when the archive is exported for Ad Hoc or Enterprise distribution (not for App Store) ?
Hello everyone! I have encountered a problem that the print function does not work correctly in any browser on devices with iOS, if you save a web page in PDF format, then the hyperlinks from this page are not saved, they just disappear, maybe this is not very important problem for everyone, but I find this an inconvenient problem.
Hi,
Trying to convert the lsaw.csstoredump file in a sysdiagnose directory in to a human readable format.
The readme file in sysdiagnose indicates
".csstoredump files:
sysdiagnose generates the output of lregister/lsaw in a binary form. To convert
these .csstoredump files to text files, use the following command:
lsaw dump --file "PATH TO DUMP FILE" > lsaw.txt
These files can also be opened in CSStore Viewer."
But no such command lsaw exists, at least not on macOS 14. No CSStore viewer either.
Any ideas where I can find this utility or convert the file? I know it's in .gz format so have also tried just decompressing it but it is still in a binary format. Also tried running strings on it but not useful.
Thanks!
Hi, I'm sorry if my question is Hello, I apologize if my question seems worthless to you.
I'm just starting out, it's my first day as an apprentice learning this programming language, and I don't have any community or mentor to help me.
I searched for my answer in the Forum but couldn't find a solution, so I'm asking my question here.
How can I, at the start of a project, choose an emulator device that includes other iPhones besides the 15 and 13? I'm looking for the iPhone 14.
I'm currently using Xcode version 15.4.
Thank you for your attention to my question.
Have a great day.
Hello,
I see the Instruments app has gotten a nice upgrade for Xcode 16. There is one issue left that has been bothering me though.
If my app is installed inside the "Application" folder, and I then try to launch Instruments for a new build of the same app from within XCode, Instruments will run the app installed in "Applications" instead of running the app I just built.
The problem with this, is that it's very easy to accidentally profile an old version of your app, and come to the wrong conclusions.
I've created a video showing this issue: https://youtu.be/IloFsQQFgSw
Good day.
I'm having problems debugging hangs. Watched the video WWDC Analyze hangs with Instruments. Apparently the main thread is blocked. It’s just not possible to analyze what exactly is blocking the flow. Please help me figure it out.
https://drive.google.com/file/d/1QvFK4y79CG0fBMrJPOrBCTuWsOaqichY/view?usp=share_link <- trace
We have observed for a few months that the Instruments tool in Xcode does not show correct memory allocation for the PacketTunnelProvider process on iOS 17. The memory allocation does not exceed 6-7 MB, which is not the case with iOS 16 or 15. Additionally, Instruments crashes the PacketTunnelProvider process after profiling for a few minutes.
Please note that I am not running Xcode in debugger mode for the PacketTunnelProvider process along with instruments, as this is a known issue that causes the PacketTunnelProvider to be killed when both Instruments and the Xcode debugger are running.
Is anyone else facing this issue and have a workaround?
I have been able to get rid of reported memory leaks in Instruments not by fixing a leak but by adding some lines (like releasing a previous nil object) that convinced Instruments it is not a leak.
But I am stuck are some I cannot stop Instruments from reporting. It reports a leak in this code
if(expr.length>0)
{ // add previous Atomic
Atomic *atom = [[Atomic alloc] initWithString:[string substringWithRange:expr] isNumber:aNum];
[exprTokens addObject:atom];
[atom release];
}
}
and it underlines the substringWithRange method. I changed code to explicitly release atom and I assumed substringWithRange would return an autoreleased new string. I am aware Instruments tells you where the leaked object is created and not where it is leak, but only things created here are atom and a sub string and atom is released immediately.
The initWithString method might do it, but I don't find anything there. Also, while running instruments, this code is 8542 times (I am pretty sure always in the same context) and Instruments says it only leaks 61 times.
I don't now if there is misunderstanding are a code problem?
the downloads button in safari keeps flickering and cannot be pressed no matter what.
Error when trying to generate CoreML performance report, message says
The data couldn't be written because it isn't in the correct format.
Here is the code to replicate the issue
import numpy as np
import coremltools as ct
from coremltools.converters.mil import Builder as mb
import coremltools.converters.mil as mil
w = np.random.normal(size=(256, 128, 1))
wemb = np.random.normal(size=(1, 32000, 128)) # .astype(np.float16)
rope_emb = np.random.normal(size=(1, 2048, 128))
shapes = [(1, seqlen) for seqlen in (32, 64)]
enum_shape = mil.input_types.EnumeratedShapes(shapes=shapes)
fixed_shape = (1, 128)
max_length = 2048
dtype = np.float32
@mb.program(
input_specs=[
# mb.TensorSpec(enum_shape.symbolic_shape, dtype=mil.input_types.types.int32),
mb.TensorSpec(enum_shape.symbolic_shape, dtype=mil.input_types.types.int32),
],
opset_version=mil.builder.AvailableTarget.iOS17,
)
def flex_like(input_ids):
indices = mb.fill_like(ref_tensor=input_ids, value=np.array(1, dtype=np.int32))
causal_mask = np.expand_dims(
np.triu(np.full((max_length, max_length), -np.inf, dtype=dtype), 1),
axis=0,
)
mask = mb.gather(
x=causal_mask,
indices=indices,
axis=2,
batch_dims=1,
name="mask_gather_0",
)
# mask = mb.gather(
# x=mask, indices=indices, axis=1, batch_dims=1, name="mask_gather_1"
# )
rope = mb.gather(x=rope_emb.astype(dtype), indices=indices, axis=1, batch_dims=1, name="rope")
hidden_states = mb.gather(x=wemb.astype(dtype), indices=input_ids, axis=1, batch_dims=1, name="embedding")
return (
hidden_states,
mask,
rope,
)
cml_flex_like = ct.convert(
flex_like,
compute_units=ct.ComputeUnit.ALL,
compute_precision=ct.precision.FLOAT32,
minimum_deployment_target=ct.target.iOS17,
inputs=[
ct.TensorType(name="input_ids", shape=enum_shape),
],
)
cml_flex_like.save("flex_like_32")
If I remove the hidden states from the return it does work, and it also works if I keep the hidden states, but remove both mask, and rope, i.e, the report is generated for both programs with either these returns:
return (
# hidden_states,
mask,
rope,
)
and
return (
hidden_states,
# mask,
# rope,
)
It also works if I use a static shape instead of an EnumeratedShape
I'm using macOS 15.0 and Xcode 16.0
Edit 1:
Forgot to mention that although the performance report fails, the model is still able to make predictions
I've been seeing warning like the following with my Apple Watch app:
=== AttributeGraph: cycle detected through attribute 140952 ===
=== AttributeGraph: cycle detected through attribute 131640 ===
=== AttributeGraph: cycle detected through attribute 131640 ===
=== AttributeGraph: cycle detected through attribute 131640 ===
=== AttributeGraph: cycle detected through attribute 131640 ===
=== AttributeGraph: cycle detected through attribute 131640 ===
=== AttributeGraph: cycle detected through attribute 131640 ===
I've done some debugging with Instruments and Xcode, I've determined that its caused by adding a
.toolbar {
ToolbarItemGroup(placement: .topBarTrailing) {
Label("Stop", systemImage: "xmark")
}
}
to an item within my NavigationSplitView List Destination view.
To aid reproduction of this issue even more, I've verified the same warning occurs with the Apple sample code from the WWDC23 Backyard Birds app.
https://developer.apple.com/documentation/swiftui/backyard-birds-sample?changes=_9
If you take the Apple sample code, open it in Xcode 15.4 and run it in the Apple Watch WatchOS 10.5 simulator, then select the Bird Springs item, all is well.
If you then add the above toolbar code to the BackyardSummaryTab file at the bottom of the VStack, you'll see the same AttributeGraph issues I'm seeing in my app.
Is this a bug? I can't understand why adding a static ToolBarItem in WatchOS is causing this.
I've seen this issue in the simulator and also on device.
Is there way to identify process which is handling a global keyboard shortcut? Let's say I press some CMD-ALT-L in any application, some file shows up on disk and there is no any kind of visual indication of where it's coming from. How do I find the offender?
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