The gmbal API call in metro (and in GlassFish WebServicesContainer.java)
mom = ManagedObjectManagerFactory.createFederated(MONITORING_SERVER);
is causing a large number of gmbal instances to be created and is affecting GlassFish performance. See http://java.net/jira/browse/GLASSFISH-17044.
Attached is the call stack.
To reproduce follow the steps in GLASSFISH-17044, except deploy a web service instead of an app with an EJB.
The fix should be to defer the gmbal API calls until there is a JMX client connection.
From Naman: JMX service would start on 8686 (on DAS). So you can check localhost:8686 for the same. From quicklook workspace you can find the sample for the same.
In GlassFish monitoring (StatsProviderManagerDelegateImpl), we defer the gmbal API calls by extending MBeanListener.CallbackImpl and overriding mbeanRegistered method. This method is called when AMX DomainRoot is loaded (when there is a JMX connection, for example). AMX DomainRoot needs to be ready before any other mbeans can be registered.
Fix should be targeted for GlassFish 3.1.2.