Currently JacORB does each servant deactivation within a separate thread. I think this was introduced as fix to bug 204. Unfortunately, for bigger numbers of servants, the thread creation and start results in a huge performance penalty. We have an application that at one time frees some 4000 servants, at this point the vm crawls, sometimes even gets out of memory. (http://lists.spline.inf.fu-berlin.de/pipermail/jacorb-developer/2007-August/009053.html) I attach a patch that creates only one thread per POA. This thread waits on a edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue. In the remove method the servant data is put onto this queue. Unfortunately my patch creates a core JacORB dependency on backport-util-concurrent.jar. I could have used java.util.concurrent but this creates a dependency on Java 1.5 I have looked for a queue implementation in JacORB core but I did not find one.
Created attachment 321 [details] diff -u AOM.java.orig AOM.java
*** Bug 527 has been marked as a duplicate of this bug. ***
Fix has been applied to CVS. As JacORB depends on JDK1.5 backport-util-concurrent is not required.