We have been using lsof and found that the open fd's are coming from the thread that is performing the ftp poll. The fd counts have climbed upto 600-700 with the process upper limit set to 1024. The strange thing is that the fd's do get cleaned up on a periodic basis (every several minutes)which we think may be the result of JVM garbage collection. However, depending on system load we do occasionally hit the 1024 limit at which point we start to throw exceptions. Shown below are a few lines from lsof:
The socket close method is closing our connections to the FTP hosts as expected but for some reason the fd's hang around for several minutes.
Thanks,
JR.