h2non / bimg

Go package for fast high-level image processing powered by libvips C library
https://pkg.go.dev/github.com/h2non/bimg?tab=doc
MIT License
2.71k stars 338 forks source link

Memory leak in image watermarking #138

Open ajdevries opened 7 years ago

ajdevries commented 7 years ago

I know it isn't released yet, but very happy with the image watermarking functionality. But there is a memory leak in it. Not sure how to fix it. If you can give me some pointers I can probably fix it myself.

I'm using it for an in production service.

When running the WatermarkTest with a for loop i.e. 200 times, you can see the memory increase.

Tried some pointer dereferencing, but then the test hangs:

  defer C.g_object_unref(C.gpointer(image))
  defer C.g_object_unref(C.gpointer(watermark))
ajdevries commented 7 years ago

Maybe @jaume-pinyol knows what is happening?