Comments (8)
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 [email protected]
on 19 May 2013 at 7:01
from thumbnailator.
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 [email protected]
on 19 May 2013 at 7:14
from thumbnailator.
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 [email protected]
on 19 May 2013 at 7:38
from thumbnailator.
[deleted comment]
from thumbnailator.
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 [email protected]
on 20 May 2013 at 1:56
from thumbnailator.
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 [email protected]
on 20 May 2013 at 2:12
from thumbnailator.
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 [email protected]
on 20 May 2013 at 2:22
- Changed state: Duplicate
from thumbnailator.
Please add Will Tran <[email protected]> to the acknowledgement list,
thanks!
Original comment by [email protected]
on 21 May 2013 at 5:51
from thumbnailator.
Related Issues (20)
- Watermark position incorrect for images re-oriented using EXIF metadata HOT 3
- Move to GitHub (and transition to a Git repository) HOT 5
- Change build from Ant to Maven HOT 4
- Google Project Hosting will drop support for Downloads HOT 3
- Using JAI library? HOT 1
- Thumbnailing problem for a specific JPEG image HOT 1
- OutOfMemoryError: Java heap space / Builder.asBufferedImage HOT 3
- Exception on opening nested folder HOT 5
- Recursively process images in nested directories
- Low quality when resizing a GIF image HOT 2
- Unexpected behaviour when using toFile without an extension matching output format HOT 1
- Support animated GIFs HOT 2
- Javadoc on Thumbnailator class has unclear remark on OutOfMemoryError HOT 3
- Implement a workaround for common OutOfMemoryError cases HOT 15
- java.lang.OutOfMemoryError: Java heap space after adding thumbnailator-feature-oom-workaround-SNAPSHOT.jar file HOT 6
- Please retain debug information in published JAR HOT 3
- forceSize Not maintaining the Aspect Ratio of thr original image HOT 5
- "Image cannot be null" when using `Thumbnails.of(BufferedImage...)` HOT 2
- Use embedded thumbnail from large JPEG images HOT 1
- SVG not supported
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thumbnailator.