-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
5.0
-
sparc
-
solaris_10
FULL PRODUCT VERSION :
ADDITIONAL OS VERSION INFORMATION :
OS independent.
A DESCRIPTION OF THE PROBLEM :
The implementation of javax.imageio.ImageIO.read(ImageInputStream) and thus all those other methods that depend on it, may be unsafe (leak resources).
The trailing stream.close() and reader.dispose() calls should be in nested finally clauses to ensure that resources are released even if an exception is thrown during the image read, eg from a corrupt image.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Likely to cause OOM if busy application is forced to wait for finaliser to release resorces.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Effectively inline all the code down to this and implement the nested finally clauses myself.
ADDITIONAL OS VERSION INFORMATION :
OS independent.
A DESCRIPTION OF THE PROBLEM :
The implementation of javax.imageio.ImageIO.read(ImageInputStream) and thus all those other methods that depend on it, may be unsafe (leak resources).
The trailing stream.close() and reader.dispose() calls should be in nested finally clauses to ensure that resources are released even if an exception is thrown during the image read, eg from a corrupt image.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
Likely to cause OOM if busy application is forced to wait for finaliser to release resorces.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Effectively inline all the code down to this and implement the nested finally clauses myself.
- duplicates
-
JDK-6336804 javax.imageio.ImageIO possible handle leak in some methods
-
- Resolved
-