nsfwjs icon indicating copy to clipboard operation
nsfwjs copied to clipboard

Memory leak using `classifyGif` on Node.js

Open ExecutionSpeed opened this issue 3 years ago • 2 comments

I think we might have to add an image.dispose() to the classifyGif operation to avoid memory leak.

https://github.com/infinitered/nsfwjs/blob/58844e357b5c684ccf8a68f94094e79f0e246b33/src/index.ts#L244-L245

Possibly adding the image.dispose() below here post classify(...) of each frame?

ExecutionSpeed avatar Jul 05 '22 07:07 ExecutionSpeed

that makes sense. Would you be so kind as to open a PR?

GantMan avatar Jul 05 '22 15:07 GantMan

Sure, I can do that.

ExecutionSpeed avatar Jul 09 '22 23:07 ExecutionSpeed