- Run jconsole, connect "remotely" to DJ as a user with the correct privileges. Quit jconsole.
- Repeat that two more times.
- Take a heapdump.
The heapdump shows that there are 3 instances of JmxClientConnection still in the heap. Using a debugger I can see that our When jconsole exits, our JmxClientConnection.handleNotification(Notification,Object) method is not called immediately. The RMI sockets close, and about 150s later our handleNotification method gets called to close the connection. I can see in a later heapdump that we still have JmxClientConnection objects in the heap with disconnectStarted=true.
In the JmxClientConnection constructor we add the instance as a notificationlistener, but there's no corresponding call to remove the JmxClientConnection as a notificationlistener.
The customer is able to demonstrate the server reporting an OOME after sufficient numbers of JMX connections are made.