In the application I am currently developing I have a requirement to watch the memory usage of the WKWebView. I cannot figure out how to do this. As WKWebView runs seperate from the main app, so getting diagnostics on the main app do not reflect the WKWebView.
Has anyone done this before?
It seems as though on iOS 9 you simply cannot look at other processes running. So that option is out. However I am still not sure, is WKWebview even another process? I notice when launching a new WKWebView, it creates new threads under mach_task_self. So that implies to me the WKWebView is not actually a seperate process, but is in the same process / mach task as the main app. But it's memory is in a different address space.
Is it possible to somehow grab the seperate memory space of the WkWebview through the low level mach and posix methods?
Or is there any other way to get the memory usage of the WkWebView?
In Xcode, choose "Product" and then select "Profile", after the compilation,it will open Instruments.
Select Activity Monitor and click Choose.
Click the red circle at the top left to start profiling.
Try to find the process named as "com.apple.WebKit", the column of "Real Mem" is what you wanted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With