I run a similar situation/setup.
I need to connect to 10 servers, (and originally 20 times a piece.)

What I found to be most efficient and reliable.

at the start of the processes, make the 10 connections (I throw them in a
HashMap) , and keep them
Every time I need to use the connection, I pick it out of the hashmap,
verify it isn't closed, use it for what it's worth, and don't close it.  If
it is closed when I try to use it, the check will reopen the connection.
But I don't close and re open, too expensive...


Might work for you, might not....

Chad


On Thu, Mar 3, 2011 at 4:54 AM, prakash babu <jprakashb...@yahoo.co.in>wrote:

> I have a web applications which installs software using jsch on remote
> machines. During a single install I almost connect 30 times to the remote
> host, each time executing some command. After each command i close the
> channel and session.
>
> Inspite of this com.jcraft.jsch.ChannelX11.fake_cookie_pool and
> com.jcraft.jsch.ChannelX11.fake_cookie_hex_pool still hold references to the
> com.jcraft.jsch.Session objects and hence they are not garbage collected.
>
> If 10 installs are performed using my application. 10*30=300 instances of
> com.jcraft.jsch.Session are present in the heap.
>
> Is there a way to resolve this ?
>
>
>
>
>
> ------------------------------------------------------------------------------
> Free Software Download: Index, Search & Analyze Logs and other IT data in
> Real-Time with Splunk. Collect, index and harness all the fast moving IT
> data
> generated by your applications, servers and devices whether physical,
> virtual
> or in the cloud. Deliver compliance at lower cost and gain new business
> insights. http://p.sf.net/sfu/splunk-dev2dev
> _______________________________________________
> JSch-users mailing list
> JSch-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jsch-users
>



-- 
A grasshopper walks into a bar and the bartender says "Hey, we have a drink
named after you." And the grasshopper says "Really, You have a drink named
Murray?"
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to