I am currently customizing mendelson AS2 (v1.1 b49) for internal use, and i discovered a thread leak in de.mendelson.util.clientserver.BaseClient class.
When calling disconnect method, a thread created during in connection step resides in memory.
Problem is coming from this line in connect method:
this.connector.getFilterChain().addLast("executor", new ExecutorFilter(new UnorderedThreadPoolExecutor()));
Instantiated ExecutorFilter & UnorderedThreadPoolExecutor objects are not recorded in memory and are not shut down when disconnecting.
I replaced this line by:
unorderedThreadPoolExecutor = new UnorderedThreadPoolExecutor();
executorFilter = new ExecutorFilter(unorderedThreadPoolExecutor);
unorderedThreadPoolExecutor & executorFilter being private class members.
And then, added this code to disconnect method:
After this fix, no unwanted thread resides in memory after disconnect.