sun.rmi.transport.connectionTimeout sun.rmi.transport.tcp.readTimeout sun.rmi.transport.proxy.connectTimeout

16.4.3.1 sun.rmi.transport.connectionTimeout

RMI attempts to reuse sockets. Between individual uses, a socket is dormant. Dormant sockets use resources. If a socket is unused for a long period of time, the benefit gained from reusing the socket might be outweighed by the resource commitment the socket requires. RMI therefore includes the sun.rmi.transport.connectionTimeout parameter, which specifies how long a socket will remain dormant before RMI closes it. sun.rmi.transport.connectionTimeou t defaults to 15 seconds i.e., has a default value of 15,000. On slower networks, this value should be increased. You have to set this value on both the client and the server, since both are attempting to reuse the same socket. That is, if the server sets the value to 60 seconds and the client uses the default of 15 seconds, the client will close the socket after 15 seconds. In effect, the servers parameters are overruled by the clients parameters.

16.4.3.2 sun.rmi.transport.tcp.readTimeout

sun.rmi.transport.tcp.readTimeout is the value for the underlying sockets timeout. It controls how long RMI will wait while trying to read a byte before determining that the socket is no longer working. The value of this parameter is actually just passed directly to the socket via the sockets setSoTimeout method whenever RMI creates a socket. If RMI attempts to read from the socket, and the socket times out, the socket will throw an instance of java.io.InterruptedIOException . RMI catches the instance of InterruptedIOException and throws a RemoteException on the client side. sun.rmi.transport.tcp.readTimeout defaults to 2 hours i.e., has a default value of 7,200,000.

16.4.3.3 sun.rmi.transport.proxy.connectTimeout

sun.rmi.transport.proxy.connectTimeout determines how long RMI will wait while attempting to establish a socket connection between two JVMs. If the timeout is exceeded, RMI will throw an instance of RemoteException on the client side™the client is always the JVM attempting to initiate the connection. The default value of sun.rmi.transport.proxy.connectTimeout defaults to 15 seconds i.e., has a default value of 15,000. On slower networks, this value should definitely be increased.

16.4.4 Parameters That Affect the Distributed Garbage Collector