On 7/19/12 8:38 PM,
ch...@slidestorm.net wrote:
> I've been working on a site that has the potential to use lots of large images. During testing I found the memory usage in Firefox to get rather large.. For about 150 1680x1050 images, about:memory reports 1GB for images.
Makes sense. 150 * 1680 * 1050 * 4 == 1.05 * 10^9 or so.
> Our site only shows one or two of these images at a time, but its important that they be preloaded.
So you want them preloaded (as in, cached) but not predecoded?
Can you preload them but then not hold on to all those <img> elements?
> but is there a way to reduce memory usage?
Apart from the suggestion above, not right now.
> Will a future version of Firefox handle non-visible images in a more efficient way?
Yes, though the definition of "non-visible" is not clear yet. Your best
bet is making sure the relevant <img> elements are not in the DOM; I
believe that the plan is to not eagerly decode those.
-Boris