I'm trying to apply an AffineTransform to an image in Java. Here's the code that I'm running.
AffineTransformOp op =
new AffineTransformOp(atx, interactive ? interpolationInteractive : interpolationNormal);
displayImage = op.filter(displayImage, null);
Where atx is a valid AffineTransform object. This code seems to run fine, but it leaves a very large amount of memory around after I do it a number of times, and eventually my program runs out of memory.
I'm sure this line is the culprit, because if I comment out applying the transformation, then no memory leak occurs.
I have 3 questions:
- Why is the syntax for the filter method so strange (it takes in a src, and destination, and returns a destination)?
- Why does this cause a memory leak?
- How can I fix it?
Thanks!