Hello, Background:
I am seeing what would appear to be one DGC thread allocated per exported object. This is using River 2.2 and Sun JDK 1.6.0_17. Relevant configuration parameters are below. I am observing problems with the DGC threads not being retired on a timely basis. The exported objects are proxies for Futures which are being executed on the service. The code pattern is such that the proxied Future goes out of lexical scope quite quickly. E.g., rmiCallReturningProxyForFuture().get(). Under a modest load, a large number of such Futures are exported which results in a large number of long lived DGC threads. This turns into a problem for the JVM due to the stack allocation per thread. Presumably this is not good for other reasons as well (e.g., scheduling). I have tried to override the leaseValue and checkInterval defaults per the configuration options below. I suspect that the lease interval is somehow not being obeyed, which is presumably a problem on my end. However, I can verify that the configuration values are in fact showing up in System.getProperties() for at least some of the JVMs involved (the one which drives the workload and the one that I am monitoring with the large number of DGC lease threads). Some questions: Is this one-thread-per-exported proxy the expected behavior when DGC is requested for the exported object? The DGC lease checker threads appear to expire ~14 - 15 minutes after I terminate the process which was originating the RMI requests. This is close the sum of the default leaseValue (10m) and checkInterval (5m) parameters, but maybe there is some other timeout which is controlling this? If this is the sum of those parameters, why would the DGC lease threads live until the sum of those values? I thought that the lease would expire after the leaseValue (10m default). Can the issue I am observing be caused by a low heap pressure on the JVM to which the RMI proxies were exported? If it fails to GC those proxies, even though they are reachable, could that cause DGC to continue to retain those proxies on the JVM which exported them? Is there any way to configure DGC to use a thread pool or to have the leases managed by a single thread? Is it possible that there is an interaction with the useNIO option? Relevant options that I am using include: -Dcom.sun.jini.jeri.tcp.useNIO=true -Djava.rmi.dgc.leaseValue=30000 -Dsun.rmi.dgc.checkInterval=15000 -Dsun.rmi.transport.tcp.connectionPool=true Thanks in advance, Bryan
