View number of outgoing ftp connections

I have a Java application from a provider running on Solaris that makes ftp connections to a server. The java process memory usage is increasing constantly. I suspect that the ftp connections are not being closed and this is the cause for the memory not being freed.

Can you tell me how can i know the number of ftp connections that are open on the solaris machine?

Thanks

[392 byte] By [ansanesa] at [2007-11-27 5:30:12]
# 1
netstat -anp tcp|grep 21Filter out 121, 1021, 1121, etc, and count.IOW count the number of TCP ports numbered 21. Subtract the LISTENING ports and there you are.
ejpa at 2007-7-12 14:54:03 > top of Java-index,Core,Core APIs...