I'm bulding a website where I use canvas
to display images. I have a simple logic which allows canvas resizing and rotating. However, most of the time the original image is much larger than actual canvas size so I use downscaling algorithm which give me better canvas image quality than what I can get by simply using what browser has for it.
But I have a huge memory leak at Google Chrome 41.0.2249.0 Canary (64-bit) (and maybe at Samsung Galaxy 5S stock browser - not sure if it is the same issue, but looks very similar) when I'm using this particular antialiasing algorithm. It looks like some image-related data is not going out of memory after every antialiased canvas redraw.
There is no memory issues on my other browsers - Google Chrome 39.0.2171.71 m, Firefox 34.0.5 and IE11.
jsFiddle:
with antialiasing (may consume up to 900Mb of RAM after performing a lot of redraws):
without antialiasing (almost no change in RAM consumption):
P.S.
I also had a version which reuses single Image
instance, like it is reccomended here - https://stackoverflow.com/a/26297202/682501 and I still see the memory overuse.