Java 6 Image resizing causes memory leak? -
Hello everybody,
I'm thinking that the following code results in memory leaks (or less on At least I can not continue my resource event or use the flush () space or the point of view () too much). Public stable buffard image getRGBImage (BufferedImage image) {BufferedImage convertedImage = new BufferedImage (Image.getWidth (), image.getHeight (), BufferedImage.TYPE_INT_RGB); ConvertImage.createGraphics (). DrawImage (image, 0, 0, color. WHITE, blank); Return image changed; } Public static BufferedImage getScaledImage (BufferedImage Image) {int imageWidth = image.getWidth (); Int imageHeight = image.getHeight (); Intensity = height (WIDTH * image hight) / imageWidth; Double Scale X = (Double) WIDTH / (Double) Imageview; Dual scale = = (double) height / (double) image light; AffineTransform scale transform = AffineTransform.getScaleInstance (scaleX, scaleY); AffineTransformOp bilinearScaleOp = New AffineTransformOp (Scale Transform, AffineTransformOp.TYPE_BILINEAR); Return Balinier Scalop. Filter (Image, new buffard image (WIDTH, height, image. Gatetype ()); } Public static zero main (string [] args throws IOException {file f = new file ("C: \\ temp \\ picture \\ sample.jpg"); File f2 = new file ("C: \\ Temp \\ picture \\ newFile.jpg"); Buffard image img = imago Reed (F); Img = getScaledImage (img); Img = getRGBImage (IMG); ImageIO.write (IMG, "JPG", F2); }
I am using jdk 6u31 and I know that when I use any other jdk (I used to try something with JDK 7) absolutely no problem is. Is this an official bug that has been solved?
Thanks in advance.
Comments
Post a Comment