Memory leak in getImageData and passing to worker

In my main page it has a timer(1 second) to pass data to worker. The code is attached, the worker does nothing.

The memory in task manager keeps increasing very fast, how to avoid the memory leak?

let canvas = document.getElementById('mycanvas');
let video = this.runtime.ioDevices.video.provider.video;
canvas.getContext('2d').drawImage(video, 0, 0, 640, 480);
let canvas_data = canvas.getContext('2d').getImageData(0, 0, 640, 480).data
window.myWorker.postMessage({ type: "test", file: file, data: canvas_data });