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:
java 7373 sonicdev 378u IPv4 0x300399ab338 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 379u IPv4 0x300468ffd58 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 380u IPv4 0x3004322c968 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 381u IPv4 0x30033c6fbe8 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 382u IPv4 0x30043cf3710 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 383u IPv4 0x3001edd2b90 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 384u IPv4 0x3001edea7c8 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 385u IPv4 0x30043f9dae8 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 386u IPv4 0x300087641f0 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 387u IPv4 0x30042517080 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 388u IPv4 0x3004250d1d0 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 389u IPv4 0x300429c95b8 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 390u IPv4 0x3001cd9ce48 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 391u IPv4 0x300432276b0 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 392u IPv4 0x3004055edf0 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
java 7373 sonicdev 393u IPv4 0x3004338e970 0t0 TCP sundvl04:*->ficlibm01.fmr.com:* (IDLE)
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.