WKWebView (+ UIWebView) Memory Leak in iOS 12.0+

Number:rdar://45854674 Date Originated:11/6/2018
Status:Open Resolved:
Product:Webkit Product Version:12.0
Classification:Memory Leak Reproducible:Always


This bug seems to affect WKWebView and UIWebView on iOS 12+. When initializing a webview instance, it always leaks. This only started happening in iOS 12.0. Going back to iOS 11.4, the leak is not present. It appears the leak is coming from the same place for both WKWebView and UIWebView, and both leak the same amount of memory (see attached instruments exports). Instruments reports the leak to be coming from JavaScriptCore.

Steps to Reproduce:

1. Run attached sample project on iOS 11.4 simulator. Observe no leak. There are 2 schemes available in the sample project: the first for running WKWebView and the second for UIWebView. 
2. Run attached sample project on iOS 12.0/12.1 simulator. Observe 4 new leaks (96b x 3 and 128b x 1). 

Expected Results:

No leaks.

Actual Results:

4 leaks.


iOS 12.0
iOS 12.1


Fixed in iOS 13 beta

This appears to be fixed in iOS 13 beta

By craig.rouse at July 3, 2019, 12:37 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!