Archived

This topic is now archived and is closed to further replies.

javanerd

[java] Memory Leak In JDK 1.3 javax.sound.sample?

Recommended Posts

javanerd    122
Has anyone experiences with the javax.sound.sample classes? I''m trying to implement sample streaming from a file (for game background music etc.) for my GameFrame for Java library and I''ve encountered a disturbing problem. I setup a SourceDataLine to accept the PCM data I read with a self made sample file reader. Otherwise the thing works just fine, the sample plays, but the Runtime.getRuntime().totalMemory() shows that the memory need of the runtime grows quite rapidly and after a minute or so playing the 44,1KHz, 16-bit, stereo sample the program terminates with java.lang.OutOfMemoryError. Does anyone have an insight what might be causing this? I''ve taken great care to avoid any memory reservations in my code that does the reading of the file and moving of the data from the file input stream into the sample output stream.

Share this post


Link to post
Share on other sites
javanerd    122
Oh well, found the bug in Bug Parade:
Bug Id: 4327019
Votes: 21
Synopsis: long running 8 Khz, 8-bit sound app runs out of memory
Category: java:classes_sound
Reported Against: kestrel, merlin-beta
Release Fixed: -
State: In progress, bug
Related Bugs: -
Submit Date: Mar 31, 2000

Description: Long running 8 Khz, 8-bit sound app runs out of memory using the Java Sound 1.0 API in JMF 2.0.

Workaround None.

Evaluation:
2000-03-31
We should try to fix this for ladybird (1.3.1) and JMF 2.1.

2000-08-25
No sound resource at the moment to do this for ladybird. Decommitting for ladybird and committing for merlin.

In plain English, they never tested for sound streaming even though they implemented sound streaming API . This also means that my JDK 1.3 sound engine can''t support sample streaming, luckily the man''s best friend Microsoft has implemented their DirectSound to Java mappings adequately so I can implement it under that platform

Share this post


Link to post
Share on other sites