Niklas, David, All,
please find attached the following repro/test harness artifacts
====> FDLeakBase.java
Launch this program with the following command line:
java test.FDLeak <home-dir> <time-out-in-minutes> <keystore>
<keystorepassword>
This is a program that starts an embedded FTP/S Server (M2-ish) and an
embedded FTP/S Client that pounds it with a tight CONN+NLST+DISC loop.
In our Linux *and* Windows environment we have leaks when run on JRE other
(newer) than 1.5.0_11.
We monitor leaks using "lsof -p <pid> | grep sock" on Linux, and using
SysInternals processexplorer on Windows.
FWIW on Windows the leak surfaces as a growing number of process EndPoints
in processexplorer generated dumps, which seem consistent with the symptom
reported a while ago here:
http://www.mail-archive.com/[email protected]/msg00131.html by
Gerard Frederic.
====> TestKO.java
Launch this program with the following command line (you should provide a
selfsigned keystore with related password):
java -cp . -Djavax.net.ssl.keyStore=server.jks
-Djavax.net.ssl.keyStorePassword=password TestKO
The program will loop over SSLServerSocket createServerSocket()/close() and
quickly hit the "too many files open" condition very quickly (unless you run
it on JRE 1.5.0_11).
====> TestOK.java
Launch this program with the following command line (you should provide a
selfsigned keystore with related password):
java -cp . -Djavax.net.ssl.keyStore=server.jks
-Djavax.net.ssl.keyStorePassword=password TestOK
This program is functionally equivalent to TestKO, but it's rewritten to use
just SSLSocket instead of SSLServerSocket.
This proved to be airtight in all 1.5.x 1.6.x JREs we tested.
As you see we did not venture into pathing real FTPServer yet.
Any feedback is appreciated.
Cheers,
F.