Hello Aspose,
this code
8< -------------------------------------------------------------------------------------------------------------------------
logger.debug(“Starting TIFF to JPEG conversion.”);
setProgress(0);
TiffImage tiffImg = (TiffImage) Image.load(new ByteArrayInputStream(tiffData));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int frameCount = tiffImg.getFrames().length;
final byte[][] jpegs = new byte[tiffImg.getFrames().length][];
JpegOptions jpegOptions = new JpegOptions();
int i = 0;
for (TiffFrame tf : tiffImg.getFrames()) {
if (isCancelled())
break;
baos.reset();
tf.save(baos, jpegOptions);
jpegs[i++] = baos.toByteArray();
setProgress((int) ((100.0 * i) / frameCount));
}
return jpegs;
8< -------------------------------------------------------------------------------------------------------------------------
causes Screenshot_20171110_154952.png (3.4 KB)
after it is called several times.
This is what visualvm tells me
Screenshot_20171110_152320.png (28.0 KB)
Screenshot_20171110_152543.png (25.1 KB)
I checked, the byte[][] returned at the end is not accumulated somewhere and the heap dump backs that up.
Thanks for your help!
Otto