Bug 18998 - Unbounded memory increase swapping multiple background images
Summary: Unbounded memory increase swapping multiple background images
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-11 10:02 PDT by Jason Gibb
Modified: 2022-12-07 16:18 PST (History)
5 users (show)

See Also:


Attachments
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.
Comment 4 Ahmad Saleem 2022-12-07 13:59:44 PST
I am not able to see Safari process increasing memory (I might be reading the Activity Monitor wrong here) but I do see that this test uses a lot of CPU time and while everything closed in the background except few apps, it pushed the website testpage to consume 50% plus CPU in activity monitor while opening GitHub reduced it to 30% range.

Is it something worth investigating further? Thanks!
Comment 5 Ryosuke Niwa 2022-12-07 16:18:40 PST
Yeah, I can't reproduce this.