Firstly, the following thread discusses the issue that toDataURL may increase memory consumption, but doesn't offer a way to use toDataURL safely: javascript memory leak with HTML5 getImageData
In my application, I need to call toDataURL. I have a PhoneGap application running on IOS that take photos using the native camera, tiles the images together into one collage image, and sends the final image as a binary 64 string via ajax post to a server. The part of my code that tiles the images uses an html canvas and toDataURL to accomplish that. This tiling occurs repeatedly over the lifetime of the software process. I am seeing the application memory increase until IOS aborts the process.
What would you recommend to do to be able to call toDataURL but not run out of memory? I don't see how to release this memory.
Thanks.