Hi,
I have a question regarding how JManage manages connections to a remote Connector Server/MBean Server.
I have seen that when I invoke operations on Remote MBeans, the connections in the Connector Server keep on increasing. Is this a bug?
I would like to have a feature such that the MBean Server is connected, Operation is invoked and then the connection is dropped. I found the opposite of this feature in JManage that it keeps the connections open until it is restarted.
Can some one please address my concerns? I would like to know how can I contribute to fixes like this.
Thanks.
Noor Syed
I also have observed this behavior. This is a serious memory leak, leading to difficult to resolve native heap issues on the application exposing the MBean server. For each connection, a separate thread will be maintained on the server, which will not show up as regular heap utilization, but will slowly eat away at the native heap until the application crashes, likely with some sort of cryptic "OutOfMemory:Swap space" message.
Also, I have noticed that the Heartbeat monitor does not always close its connections, although it usually does. This means an idle application will eventually crash if it is being monitored by JManage.
Sample notification monitoring from heartbeat thread:
javax.management.remote.JMXConnectionNotification[source=javax.management.remote.rmi.RMIConnectorServer@79717e][type=jmx.remote.connection.opened][message=Connection opened]
javax.management.remote.JMXConnectionNotification[source=javax.management.remote.rmi.RMIConnectorServer@79717e][type=jmx.remote.connection.closed][message=Client connection closed]
javax.management.remote.JMXConnectionNotification[source=javax.management.remote.rmi.RMIConnectorServer@79717e][type=jmx.remote.connection.opened][message=Connection opened]
javax.management.remote.JMXConnectionNotification[source=javax.management.remote.rmi.RMIConnectorServer@79717e][type=jmx.remote.connection.closed][message=Client connection closed]
javax.management.remote.JMXConnectionNotification[source=javax.management.remote.rmi.RMIConnectorServer@79717e][type=jmx.remote.connection.opened][message=Connection opened]
javax.management.remote.JMXConnectionNotification[source=javax.management.remote.rmi.RMIConnectorServer@79717e][type=jmx.remote.connection.closed][message=Client connection closed]
javax.management.remote.JMXConnectionNotification[source=javax.management.remote.rmi.RMIConnectorServer@79717e][type=jmx.remote.connection.opened][message=Connection opened]
javax.management.remote.JMXConnectionNotification[source=javax.management.remote.rmi.RMIConnectorServer@79717e][type=jmx.remote.connection.closed][message=Client connection closed]
javax.management.remote.JMXConnectionNotification[source=javax.management.remote.rmi.RMIConnectorServer@79717e][type=jmx.remote.connection.opened][message=Connection opened]
javax.management.remote.JMXConnectionNotification[source=javax.management.remote.rmi.RMIConnectorServer@79717e][type=jmx.remote.connection.opened][message=Connection opened]
javax.management.remote.JMXConnectionNotification[source=javax.management.remote.rmi.RMIConnectorServer@79717e][type=jmx.remote.connection.opened][message=Connection opened]
javax.management.remote.JMXConnectionNotification[source=javax.management.remote.rmi.RMIConnectorServer@79717e][type=jmx.remote.connection.opened][message=Connection opened]
javax.management.remote.JMXConnectionNotification[source=javax.management.remote.rmi.RMIConnectorServer@79717e][type=jmx.remote.connection.opened][message=Connection opened]
javax.management.remote.JMXConnectionNotification[source=javax.management.remote.rmi.RMIConnectorServer@79717e][type=jmx.remote.connection.closed][message=Client connection closed]
Stepping through the code in ExecuteMBeanOperationAction.java, I see this is caused by the request for MBean info:
ObjectOperationInfo operationInfo = service.getOperationInfo(
Utils.getServiceContext(context),
operationName, signature);
This call opens a connection which remains open. The call to actually execute the MBean operation opens another new connection, but this gets closed in a 'finally' block.