Bug 13050

Summary: World leaks seen on Leopard after opening then closing tab
Product: WebKit Reporter: Mark Rowe (bdash) <mrowe>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Severity: Major CC: ejalbert
Priority: P1 Keywords: InRadar
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   
URL: http://xn--sailor-183m.com/dvds/

Description Mark Rowe (bdash) 2007-03-12 21:21:56 PDT
Steps to reproduce:
1. Start a clean copy of Safari.
2. Enable "Always check for world leaks" in the debug menu.
3. Check the memory use of Safari via 'ps', 'top', or Activity Monitor.  It should be around the 32MB mark.
3. Load the URL <http://sailor&#26376;.com/dvds/>.
4. Wait several minutes for the page to load.
5. Check the memory use of Safari again.  It will be around the 250MB mark.
5. Hit command-W to close the window.
6. Check the memory use again.  Note that it is *still* around the 250MB mark.

Some time after step 5. a dialog appears stating that 3 WebDataSource objects and 3 WebHTMLRepresentation objects have been leaked.

Expected results:
No leaks.   I would also expect the memory footprint to shrink dramatically after step 5 to bring it close to the original memory footprint.
Comment 1 Mark Rowe (bdash) 2007-03-12 21:22:48 PDT
Bugzilla mangled the URL.  It is <http://xn--sailor-183m.com/dvds/>.
Comment 2 Mark Rowe (bdash) 2007-03-12 21:35:05 PDT
Comment 3 Dave Hyatt 2007-03-12 21:41:12 PDT
This is definitely memory held by the WebCore cache.  The cache is massively underreporting its size... I think this could be related to the already-filed bugs against ImageIO holding on to tons of memory in the image source.

Comment 4 Dave Hyatt 2007-03-13 00:49:52 PDT
I landed a fix to account for the larger encoded data.  On my machine everything is behaving more or less as expected now.  The WebCore cache is 128mb on very large memory machines.  The encoded size error was making it take more like 200mb.  When I close the window now on Tiger, the cache is properly full at 128mb.  So even though this looks like a giant "leak", all that has happened is that single page filled up the entire cache.  Over time the cache shouldn't grow but should stay at that maximum size.

Comment 5 David Kilzer (:ddkilzer) 2007-03-13 03:16:36 PDT
Fixed committed by hyatt in r20139.


Comment 6 Mark Rowe (bdash) 2007-03-13 03:17:36 PDT
That fix doesn't address the WebDataSource and WebHTMLRepresentation leaks I'm seeing.
Comment 7 Geoffrey Garen 2007-03-13 12:46:50 PDT
The world leaks dialog may be a red herring. I've seen cases where the TOT world leaks timer fires too soon, and checks for deallocation before all cleanup has happened. You can test for this by opening and closing an empty window after you see a world leak report. That will cause the world leak check to fire again.
Comment 8 Geoffrey Garen 2007-03-14 12:31:21 PDT
The world leaks issue seems to be Leopard-only, so I'm going to close this Bugzilla as fixed but continue to track the world leaks issue in the associated Radar.