JDK-8160217 : JavaSound should clean up resources better
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: 8,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-06-24
  • Updated: 2020-12-02
  • Resolved: 2016-08-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9 Other
8u270Fixed 9 b135Fixed openjdk8u292Fixed
Description
The test FrameLengthAfterConversion.java is leaving files in /cygdrive/c/temp with names like:

sound1062925923071199713.tmp

cat -n javax/sound/sampled/AudioInputStream/FrameLengthAfterConversion.java

   159              final File temp = File.createTempFile("sound", ".tmp");
   160              temp.deleteOnExit();

The temp.deleteOnExit(); at line 160 does not seem to be effective because our Windows build/test system in mach 5 has over 25,000 of these files.
Comments
8u review approval: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-June/012040.html final webrev: http://cr.openjdk.java.net/~zgu/JDK-8160217-8u/webrev.01/index.html
26-11-2020

8u code review: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-June/012038.html
27-08-2020

Actually the test delete this file later final File temp = File.createTempFile("sound", ".tmp"); temp.deleteOnExit(); afw.write(ais, type, temp); ais = AudioSystem.getAudioInputStream(temp); final long frameLength = ais.getFrameLength(); ais.close(); temp.delete(); It does not seem like a test bug.
27-06-2016

I wonder why deleteOnExit() does not work.
27-06-2016