I have asked this question before, but I wanted to rephrase/clarify some points and expand upon it. I have a piece of code which transforms a BufferedImage using an AffineTransform.
op = new AffineTransformOp(atx, interactive ? interpolationInteractive : interpolationNormal);
displayImage = op.filter(displayImage, null);
This code works fine, however it causes a memory accumulation. Specifically, every time this piece of code is called more memory is stored up. I have tried the other form of filter as well.
op = new AffineTransformOp(atx, interactive ? interpolationInteractive : interpolationNormal);
displayImage2 = op.createCompatibleDestImage(displayImage, displayImage.getColorModel());
op.filter(displayImage, displayImage2);
However, this is much much slower than the first version. I want the speed of the first version with the memory usage of the second.
- How can I clean up after the first version? Specifically, where are the intermediate BufferedImages stored, and how can I delete them?
- Why is the second version slower than the first? What can I do to speed it up?
Thanks for your help!!!