Closed GoogleCodeExporter closed 9 years ago
For what it's worth, the leak seems to be in the code that reads the file in.
The following code does not exhibit the same problem:
BufferedImage theImage=ImageIO.read(theFile);
currentThumbnail=Thumbnails.of(theImage).size(200, 200).asBufferedImage();
Original comment by br...@fireplan.ca
on 19 May 2013 at 7:01
But of course if you do it the way I just commented (read it in yourself) you
lose the EXIF rotation which is why I started in the first place.
Doh.
Original comment by br...@fireplan.ca
on 19 May 2013 at 7:14
I think I fixed it. Won't pretend to know exactly why. I knew something was not
being disposed of properly, so I tried adding:
reader.dispose();
directly after:
iis.close();
Around line 155 of FileImageSource.java
Heap growth is now under control.
I feel like my morning was now spent productively. Hope to see this (or
similar) patch soon :)
Original comment by br...@fireplan.ca
on 19 May 2013 at 7:38
[deleted comment]
Hi,
Thank you for taking the time and effort to report this issue.
There appears to be numerous cases of Thumbnailator encountering
`OutOfMemoryError`s when using Java 7 Update 21.
I just want to get a verification of which version of Java was being used when
you encountered this problem. (I'm going to guess it's Java 7 Update 21, also
known as Java 1.7.0_21.)
Thank you!
Original comment by coobird...@gmail.com
on 20 May 2013 at 1:56
No problem. So, I actually thought NetBeans bundled it's own JDK, but I may
have been mistaken. When I run the program and dump the appropriate system
properties or just throw -version into the VM options, the answer is the same
as from my OS X terminal window:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06-451-11M4406)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01-451, mixed mode)
Original comment by br...@fireplan.ca
on 20 May 2013 at 2:12
Thank you for the prompt reply.
It's interesting to note that the problem occurred on Java 6 Update 45.
However, that is the most recent version of Java 6 (and apparently the last
update for 6), and the `OutOfMemoryError`s on Java 7 was also the most recent
release, so it seems like something in the most recent release of Java is
causing the memory leak to be more apparent.
Issue 42 seems to be the same issue, so I will be merging this issue into that
one.
Once again, I really appreciate all the information and the prompt reply! :)
P.S. I'll try to credit the people who have reported and contributed to this
issue in the "Changes", so if you'd like to be acknowledged, please leave your
name or nickname you'd like to acknowledged by in this issue.
Original comment by coobird...@gmail.com
on 20 May 2013 at 2:22
Please add Will Tran <will.tran@xtremelabs.com> to the acknowledgement list,
thanks!
Original comment by will.t...@xtremelabs.com
on 21 May 2013 at 5:51
Original issue reported on code.google.com by
br...@fireplan.ca
on 19 May 2013 at 6:26