Summary: | SVG background-image memory usage is absurd | ||
---|---|---|---|
Product: | WebKit | Reporter: | C Snover <bugs.webkit.org> |
Component: | SVG | Assignee: | Philip Rogers <pdr> |
Status: | ASSIGNED --- | ||
Severity: | Normal | CC: | fmalita, paulirish, pdr, schenney, zimmermann |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | http://jsfiddle.net/LybU7/3/show | ||
Bug Depends on: | 106159 | ||
Bug Blocks: |
Description
C Snover
2013-02-05 18:41:20 PST
Thank you for taking the time to file this. Part of the problem is that we are caching SVG images as bitmaps, and at their native resolution (which is particularly painful for your 1024*1024 SVG file). I'm addressing that long-standing problem in wkbug.com/106159 which will fix much of the memory consumption. That still doesn't address the per-use growth in memory though; we should only need one image here! r142765 has landed so we no longer allocate huge bitmaps on a per-renderer basis. Your testcase now passes without using several Gigs of memory. You can test this yourself using Chrome Canary or the WebKit nightlies. Until this has landed in your favorite WebKit browser, a (partial) workaround is to limit the size of the SVG used for images. For example, you could use several smaller images instead of a large 1024*1024 image map. We were previously rendering the SVG into a bitmap and caching that--using a smaller image will make the memory use more reasonable. Thanks so much Philip for the quick work so far. Looking forward to being able to recommend SVG background images in future. :) |