This is not a question, but I'm posting here in the hope that it will save someone else's sanity (I've just spent the best part of a day figuring this one out). I've identified a memory leak that has appeared from iOS 12.0+, which affects WKWebView and UIWebView. The leak appears as soon as you instantiate either of the 2 webviews. Instruments identifies the leak as coming from JavaScriptCore, which I guess is why it affects both webviews equally.
I was trying to figure out what I was doing wrong, when I decided to try an older iOS version (11.4 - the version before 12.0), and I noticed the leak had disappeared. I can reproduce this every time.
To reproduce, all you need to do is allocate an instance of a webview on a class.
let webview = WKWebView()
or
let webview = UIWebView()
Immediately, you'll notice 4 leaks on iOS 12.0/12.1, which are no longer present if you run the code on iOS 11.4. There are 4 separate leaks; 3 x 96 bytes and 1 x 128 bytes.
I've filed a bug with Apple via the BugReporter, duplicated at Openradar: https://openradar.appspot.com/radar?id=6132657108811776