IOS – A specific Safari WebKit page on iOS – how to see memory usage graph in Instruments

instrumentsiosmemorymobile-safarisafari

I've set up Xcode/Instruments so that I'm monitoring an iPhone 6s's memory usage altogether. I've got a specific com.apple.WebKit Process that I would like to see very finetuned information on – as precise as possible. This com.apple.WebKit process will eventually crash the Mobile Safari running on an iPhone 6s using iOS 10 – this WebKit process will not crash an iPhone SE running iOS 11 Beta – but that's just to say that "things will eventually get better".

It seems that 1Gb of memory is not enough to run the com.apple.WebKit process for this specific scripted embed.

So, I start Instruments running and I see peaks of 640mb or so of memory usage – but how could I record this memory usage in the finest possible detail, so that I can figure out what drives this over the edge?

Best Answer

I would probably consider Instruments job done once you know mobile safari is allocating 640 MB of ram and move on to Safari web inspector. Setting it up is quite easy and since you have XCode and macOS safari, you have first party tools to debug your process while it runs in real time.

The activity viewer will right away focus your efforts based on whether you have excessive warnings and errors or simply are loading a lot of assets.

enter image description here