-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getImageData method memory leak? #819
Comments
@fancymiracle await a setTimeout before the |
Sorry, let me provide another example. Manually, every time a press occurs, it is sent from the renderer thread to the main thread as follows:
Even after repeating this process several times, the memory continuously increases, and it does not decrease as observed in the Activity Monitor. But if replace getImageData with canvas1.data(), which also retrieves the entire frame data, no memory leak occurs. However, this way, can only retrieve the entire frame rather than parts of it. |
Probably related: |
let canvas1 = createCanvas(1920, 1080)
let ctx = canvas1.getContext('2d')
for(var i=0;i<5000;i++){
const rawFrameImage = ctx.getImageData(0, 0, 1920, 1080).data;
console.info(process.memoryUsage().rss / 1024 / 1024 + " MB");
clearAllCache();
}
The memory is not released.
The text was updated successfully, but these errors were encountered: