Bug 18998 - Unbounded memory increase swapping multiple background images
Summary: Unbounded memory increase swapping multiple background images
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh Intel OS X 10.5
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2008-05-11 10:02 PDT by Jason Gibb
Modified: 2008-05-12 20:47 PDT (History)
1 user (show)

See Also:

Test case (10.90 KB, application/zip)
2008-05-11 10:03 PDT, Jason Gibb
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Gibb 2008-05-11 10:02:00 PDT
1. Unzip attached file and load HTML page in WebKit or Safari 3.x
2. Press Start Test button
3. Monitor application RSIZE in Activity Monitor as test runs

RSIZE steadily increases as multiple background images are swapped repeatedly with the same image urls. The more elements that swap background images, the faster memory usage increases. This only seems to occur when setting the background url(), not when setting background colors or other background properties.

It looks like the same images are being allocated repeatedly (and never deallocated) for every JS call to "element.background = url(image)"

I ran leaks from Terminal but didn't see anything unusual. FWIW, I see the same memory increase in Safari 3 and 3.1 but NOT in Safari 2.x or Firefox 2.x.
Comment 1 Jason Gibb 2008-05-11 10:03:48 PDT
Created attachment 21069 [details]
Test case
Comment 2 Mark Rowe (bdash) 2008-05-11 19:48:11 PDT
I cannot reproduce any memory growth on the test case with a recent build of WebKit.
Comment 3 Jason Gibb 2008-05-12 20:47:33 PDT
Created attachment 21099

That's strange... I'm able to duplicate it consistently on an Intel MBP and a PowerPC iMac both running Leopard. Tested on r33029 build of WebKit on both machines and saw the same memory growth immediately (the longer the test runs the higher it goes). I've attached a screen capture so you can see what I'm seeing.