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)
- How to ensure the GIF dynamic effect after compression HOT 1
- Do you have plans to support WebP, AVIF? HOT 1
- Thumbnail not properly generating from PNG images HOT 2
- Image color loss during conversion HOT 3
- Define an Automatic-Module-Name HOT 1
- the image format webp is not support HOT 5
- No suitable ImageReader found for source data errors HOT 1
- After resize the image is rotated HOT 3
- 300dpi tiff image changed to 96pi jpg but pixel does not chage HOT 1
- Incorrect cropping when specifying sourceRegion and an image that has exif orientation HOT 2
- Multi-threaded processing of images with large pixel width and height leads to memory OutOfMemoryError
- the .pict file is not supported HOT 1
- javax.imageio.IIOException: Invalid JPEG file structure: two SOF markers HOT 1
- Add crop method usage to examples HOT 2
- How to make the image width fixed when the image is scaled HOT 1
- Does the thumbnailator support generating thumbnails for png images? HOT 1
- Conversion error caused by image reading failure
- Native image service unable to compress image
- jpg color turn red HOT 2
- webp format image campress fail with exception "No suitable ImageReader found for source data" HOT 1
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.