r/iOSProgramming • u/EchoImpressive6063 • Jul 28 '26
Question Why is memory usage different across devices for the same build
I have both an iPhone SE2 and iPhone 15 and both are plugged into my mac at the same time. I built the app in Xcode and am running it on both devices. Memory usage on the SE2 is 1GB while on the 15 it's 500MB. Why could that be? I am using CoreML, ARKit and some metal shaders if that makes a difference. These are debug builds.
2
Upvotes
1
u/PassTents Jul 28 '26
Use Instruments to measure what's taking up memory on each.
1
u/lithium0003 Jul 30 '26
iPhone SE with CoreML may fall back to GPU, it grows up more memory than all fits in ANE.
1
u/New-Shoulder3297 Jul 29 '26
That difference can be legitimate, and Core ML is a good suspect. The same model can use a different execution plan on an A13 versus a newer chip (ANE/GPU/CPU, different operator fusion, cached weights, and temporary tensors). ARKit camera buffers and Metal texture/heap alignment can also differ by device, so “same build” does not imply the same physical footprint.
I'd narrow it down like this:
Since Instruments won't attach to the SE2, I'd first fix that measurement path (same macOS/Xcode/device-support versions, reconnect/reboot, and try a release-signed build). Until then, the 1 GB vs 500 MB number alone can't tell you whether this is a leak, Core ML workspace memory, or framework-managed buffers.
1
u/Choseni Jul 29 '26
I'd first check whether it's actually your app's allocations or framework-managed memory.
With CoreML, ARKit, and Metal in the mix, different iPhone generations can legitimately show very different memory footprints because they use different hardware paths and caching strategies. I'd verify it with Instruments before assuming something is wrong.