Skip to content
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

Memory leak when adding filter to 100 images #2

Open
Name-less opened this issue Oct 19, 2017 · 2 comments
Open

Memory leak when adding filter to 100 images #2

Name-less opened this issue Oct 19, 2017 · 2 comments

Comments

@Name-less
Copy link

Name-less commented Oct 19, 2017

Thanks for this library that work very well.

But when I apply a filter on server side with nodejs over 100 images one after another, the memory of the server increase to 300 Mo, and when it's over, the memory is not released and the server still take 300 Mo of memory until we restart it.

It is possible that the issue came from the node-canvas library used, see :
Automattic/node-canvas#1003

Are you compatible with node-canvas 2.0-alpha ?

@Name-less
Copy link
Author

After some researches, a workaround is possible
Automattic/node-canvas#785

add img.src = null; on your importImage function on the onload callback

I will try it out ...

@Name-less
Copy link
Author

Finally adding

process.nextTick(function() {
img.onload = null;
});

Fix the leak, I fork the project here : https://github.com/Name-less/filterous-2/releases/tag/2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant