How do I debug a buildup in "page" memory in safari dev tools?

226 Views Asked by At

I am trying to debug a large memory leak I am seeing in a webview embedded in a unity app. Unfortunately, I am stuck using safari dev tools.

In the dev tools I see that my JS heap is staying steady, around 75mb. However, my "page" memory is growing quickly. Over the course of 10 minutes or so it grew from 272mb to up over 1gb.

I don't know how to tell what is taking up all that "page" memory. Is there a way I can see what is building up, similar to the javascript allocations timeline?

1

There are 1 best solutions below

3
hex494D49 On

If you need something similar to JavaScript allocations timeline, you can do the exact thing in Safari following these steps

Safari DevTools -> Memory tab -> Start Recording JavaScript Allocations

Let the application run for a while; then stop the recording and check the timeline for any significant allocations

In addition, you can do a couple other checks as described below

Safari DevTools -> Memory tab -> Start Recording Heap Allocations

After a while, stop the recording and check the timeline for any significant allocations

Safari DevTools -> Memory tab -> Record

Again, stop the recording after a while, take a snapshot using the Take Heap Snapshot button and then compare multiple snapshots in order to identify objects that aren't being garbage collected.