FreeTTSWordToSound is not deallocating Voices thus causing memory leakage

Description

Voice.java threads are remaining open because they are not deallocated. I am using the SpellerSoundFactory, SoundCaptchaFactory, SimpleCaptchaService, GenericCaptchaEngine and FreeTTSWordToSound. The FreeTTSWordToSound is definitely the problem. When viewing the source code for this class, there is no Voice.deallocate() method being called anywhere even though Voice.allocate() is called. There needs to be a method of deallocating the Voice objects (which are Runnable) thereby closing the threads and freeing up much needed memory during garbage collection.

I did a full stack dump of the JVM this morning. There are 360 stuck threads of type com.sun.speech.freetts.Voice$1. This is the cause of the problems.
---------------------------

"Thread-23" daemon prio=5 tid=0x007646c8 nid=0x54 in Object.wait() [0x409ff000..0x409ffc28]
at java.lang.Object.wait(Native Method)

  • waiting on <0x8eb77278> (a com.sun.speech.freetts.OutputQueue)
    at java.lang.Object.wait(Object.java:429)
    at com.sun.speech.freetts.OutputQueue.pend(OutputQueue.java:97)

  • locked <0x8eb77278> (a com.sun.speech.freetts.OutputQueue)
    at com.sun.speech.freetts.Voice$1.run(Voice.java:471)

"Thread-22" daemon prio=5 tid=0x011feb10 nid=0x53 in Object.wait() [0x40aff000..0x40affc28]
at java.lang.Object.wait(Native Method)

  • waiting on <0x8eb77300> (a com.sun.speech.freetts.OutputQueue)
    at java.lang.Object.wait(Object.java:429)
    at com.sun.speech.freetts.OutputQueue.pend(OutputQueue.java:97)

  • locked <0x8eb77300> (a com.sun.speech.freetts.OutputQueue)
    at com.sun.speech.freetts.Voice$1.run(Voice.java:471)

Environment

BEA Weblogic 8.1 SP5 SunOS/Windows XP/Linux RHEL 2.5GB or RAM allocated to the 1.4.2 JVM.

Assignee

AntoineV

Reporter

Kevin Boutin

Labels

None

Components

Fix versions

Affects versions

Priority

Critical
Configure