I'm working on a slide-show-like web app in which the current image is drawn onto a canvas and you can flip through images with next/prev buttons. The images a loaded with someImage.src
and for performance reasons I'm doing that in background while user views first image.
Firefox allocates lots of memory during that preloading (up to 20-30 times more than Chrome or Safari do and even twice as much as IE). Moreover, if I change the slide show, which I can do via loading an xml description of the slide show in background (with a drop down menu) while the URL of the web site remains the same, no memory is freed, but a lot new is allocated. Not until I change or reload the URL of the web site Firefox deallocs the memory. This behavior is different to all other browsers.
What's going on there? Why is Firefox so hungry? Any ideas, how to fix that? Is there a way to force Firefox to free memory or to reduce the memory it uses for pre-caching loaded (but not shown) images?