activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Vijlbrief <>
Subject Re: [Spam: 5.0] Memory usage increase after client power failure
Date Sat, 24 Feb 2007 13:04:20 GMT

> transportConnector.  Maybe I am misunderstanding the purpose of the
> transportConnector soTimeout or have specified it incorrectly.
> <transportConnector
> uri="tcp://servername:61616?soTimeout=10000?jms.useAsyncSend=true?jms.dispa

It took quite some time to figure this out, you should use:


This is really not clearly documented. 

You should also experiment with keepAlive: 


or a combination:


The signature for setKeepAlive in TcpTransport is Boolean keepAlive (Uppercase 
B instead of boolean) and I couldn't figure out how to set it in the URI. 
Shouldn't all Booleans in TcpTransport be boolean anyway?

I changed the signature to:

public void setKeepAlive(boolean keepAlive)

so that the option is settable.

I think the correct way to approach your problem is the keepAlive option
and NOT the soTimeout option. The keepAlive option should have
the effect that a dead connection is detected. The time is depending
on your OS and its specific settings. See:

if you're using Linux.


tcp_keepalive_intvl (integer; default: 75) 
The number of seconds between TCP keep-alive probes. 
tcp_keepalive_probes (integer; default: 9) 
The maximum number of TCP keep-alive probes to send before giving up and 
killing the connection if no response is obtained from the other end. 
tcp_keepalive_time (integer; default: 7200) 
The number of seconds a connection needs to be idle before TCP begins sending 
out keep-alive probes. Keep-alives are only sent when the SO_KEEPALIVE socket 
option is enabled. The default value is 7200 seconds (2 hours). An idle 
connection is terminated after approximately an additional 11 minutes (9 
probes an interval of 75 seconds apart) when keep-alive is enabled.

I suggest setting tcp_keepalive_intvl to 5 and tcp_keepalive_intvl to 3

Anyway, if you want to experiment with soTimeout:
Note that the run() method in TcpTransport is currenty ignoring 
try commenting out two lines:
    public void run() {
        log.trace("TCP consumer thread starting");
        while (!isStopped()) {
            try {
                Object command = readCommand();
//            catch (SocketTimeoutException e) {
//            }
            catch (InterruptedIOException e) {
            catch (IOException e) {
                try {
                catch (Exception e2) {
                    log.warn("Caught while closing: " + e2 + ". Now Closed", 

Good luck,


View raw message