How do i find the culprit of "exceeded mem limit" errors on iOS devices visiting a particular web page?

With a physical iPhone attached to the dev tools on my laptop, the memory usage of this web page

https://nypost.com/2023/10/11/australian-swimmers-almost-walk-into-shark-as-it-swims-close-to-shore/

consistently grows until it reaches the memory limit of the device (in my case, about 1.5GB)

The safari dev tools has a memory profiler timeline which breaks down memory usage into categories including "Javascript", "Layers", and "Page"; is there a way to break these down further to individual scripts/resources?

I have also tried looking at the Javascript allocations profiler, but the computed heap size reported in its snapshots never comes anywhere close to the 700+ MB of "JavaScript" memory usage reported by the Memory profiler.

Replies

If you're a web developer for the NYPost, you might want to try <https://webkit.slack.com/> to see if you can help WebKit devs to reproduce this issue.

If you have any extensions installed, try disabling them to see if the issue still reproduces.

If you can reproduce similar memory growth in iOS Simulator on a Mac, then you can use Mac memory tools like leaks, vmmap and Instruments.app to monitor memory usage.

Also, would help to know if this is iOS 17 or an earlier build.

Thanks for the reply.

This is iOS 17.0.3, no extensions.

These docs (https://help.apple.com/simulator/mac/current/#/devb0244142d) say that the Simulator is "not an accurate test of an app's memory usage"... Does your advice take that into consideration? Either way, I've tried connecting the dev tools to a Simulator, and the timelines panel consistently freezes and stops displaying new data. I do sometimes see that memory usage exceeds the 1.5GB limit before it freezes.

As for leaks and vmmap, how would I get the process ID of the simulator's webkit? Or do you mean passing them the simulator's process ID?

  • @Developer Tools Engineer , ping! Unsure if my reply notified you.

Add a Comment