1

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:

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.

Community
  • 1
  • 1
mykola.rykov
  • 522
  • 6
  • 13

0 Answers0