Re: DGCClient$EndpointEntry stuck
Peter Jones - JavaSoft East <[email protected]>
| Newsgroups | gmane.comp.java.sun.rmi |
|---|---|
| Message-ID | <20041210192251.GE1489@east> |
> I too am having problems with DGC threads, though in my case they
> get stuck in endless loops creating sockets, eventually starving the
> machine of resources. The application uses socket factories (and
> also subclasses Socket so I can track them) and of course has
> hashCode and equals methods on the socket factory class. The
> machine where the problem has occurred is actually the server; lots
> of clients make RMI calls to the server for info. Separately, the
> server connects to each client occasionally to pull data up (which
> makes load management on the server much easier). It is this
> process that somehow triggers the 'runaway' socket creation process.
> In the custom socket class, I log socket creation time and a stack
> trace so I can see that sometimes a DGC thread on the server
> (actually being an RMI client) creates sockets to a client (acting
> as an RMI server) every 20 minutes.
Recurring DGC "dirty" calls to an endpoint are expected while there
are live remote references to remote objects at that endpoint in the
local virtual machine (like this "server"), for renewing the DGC
lease. The interval is affected by the duration of the lease granted
by the endpoint's VM, which can be controlled by the setting of the
"java.rmi.dgc.leaseValue" system property in that VM:
http://java.sun.com/j2se/1.4/docs/guide/rmi/javarmiproperties.html
> In one instance the interval was just seconds.
If a DGC "dirty" call fails for some reason, it is retried (assuming
at least the J2SE 1.3 implementation), first quickly, and then with an
exponentially-increasing delay until eventually giving up-- at which
point it should not be retried until a new remote reference with the
same endpoint enters in the VM.
> And the sockets don't get closed either,
That would be a problem. Do you also log invocations of close() on
your custom socket class? If so, you don't see any invocations of it
from threads named "RMI ConnectionExpiration-[...]"?
> so doing a netstat comes up with a long list of unconnected sockets.
Could you be more specific?
-- Peter
===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS". For general help, send email to
[email protected] and include in the body of the message "help".
For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html
To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html