JVips icon indicating copy to clipboard operation
JVips copied to clipboard

Potential memory leak

Open esiqveland opened this issue 1 year ago • 7 comments

We are testing JVips as mainly a jpeg thumbnail processor. So far we only pass a java byte[] array, as we already hold this on the heap.

This is roughly what we do:

        byte[] contents = thumb.getBlob();
        try (VipsImage image = new VipsImage(contents, contents.length)) {
          ...
          image.colorspace(Srgb)
          image.thumbnail(...)
          image.autorot();
 
          var output = image.writeJPEGToArray(JPEG_COMPRESSION_QUALITY, true);
          return output;
       }

But when we enable the JVips processor, several instances are almost immediately going OOM:

image

Processing with the above code was enabled around 09:17 in the above.

Is this something you have seen with VipsImage or are we using it wrong?

Is there a way I can help track this down?

esiqveland avatar Mar 30 '23 07:03 esiqveland