I'm repeatedly passing image data from an HTML5 canvas
to a Web Worker using a Transferrable Object --
Condensed Code:
var worker = new Worker("test.js");
setInterval(function () {
var data = context.getImageData(0, 0, canvas.width, canvas.height);
worker.webkitPostMessage(data, [data]);
}, 100);
The problem is that memory usage increases astronomically every few seconds and doesn't appear to decrease when the function isn't being called. For cases in which the memory usage exceeds a certain threshold, chrome will actually crash as a result of this leak. I would welcome any and all suggestions, including alternative methods for sending data to the Web Worker. Many thanks!