-
Bug
-
Resolution: Fixed
-
P3
-
7u9
-
b78
-
generic
-
windows
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8135825 | emb-9 | Sergey Bylokhov | P3 | Resolved | Fixed | team |
FULL PRODUCT VERSION :
JDK7u9
ADDITIONAL OS VERSION INFORMATION :
Windows XP, Windows 7, Windows Server 2008
A DESCRIPTION OF THE PROBLEM :
try{
File f = new File(main.getWavFileName(0, tab));
AudioInputStream audioInputStream =AudioSystem.getAudioInputStream(f);
audioInputStream.close();
audioInputStream = null;
f = null;
}catch(Exception e) {
e.printStackTrace();
}
try {
Files.delete(Paths.get(f2.getAbsolutePath()));
} catch (IOException e) {
e.printStackTrace();
}
In the above code the file could not be deleted even after AudioInputStream was closed. The same code works well with Java 1.6.
REGRESSION. Last worked in version 6u31
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Steps are given in the description
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
File should be deleted once AudioInputStream is closed.
ACTUAL -
Invoking .close() on AudioInputStream object does not release resource it is holding.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
The only workaround that I see is calling System.gc() explicitly but it might cause performance issues.
JDK7u9
ADDITIONAL OS VERSION INFORMATION :
Windows XP, Windows 7, Windows Server 2008
A DESCRIPTION OF THE PROBLEM :
try{
File f = new File(main.getWavFileName(0, tab));
AudioInputStream audioInputStream =AudioSystem.getAudioInputStream(f);
audioInputStream.close();
audioInputStream = null;
f = null;
}catch(Exception e) {
e.printStackTrace();
}
try {
Files.delete(Paths.get(f2.getAbsolutePath()));
} catch (IOException e) {
e.printStackTrace();
}
In the above code the file could not be deleted even after AudioInputStream was closed. The same code works well with Java 1.6.
REGRESSION. Last worked in version 6u31
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Steps are given in the description
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
File should be deleted once AudioInputStream is closed.
ACTUAL -
Invoking .close() on AudioInputStream object does not release resource it is holding.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
The only workaround that I see is calling System.gc() explicitly but it might cause performance issues.
- backported by
-
JDK-8135825 audioInputStream.close() does not release the resource
-
- Resolved
-
- duplicates
-
JDK-8076990 AudioInputStream.close() not releasing resources hook
-
- Closed
-
- relates to
-
JDK-4325421 Something wrong with the close() method of AudioInputStream class
-
- Closed
-
-
JDK-8024949 Code duplication in subclasses of AudioFileReader should be removed.
-
- Open
-