What version of GlassFish are you using?
In the v2 trunk source code for AppServerConnectionSource, I'm seeing a
getMBeanServerConnection method that takes a "forceNew" argument that
determines whether a new connection should be created or not. There is
also a getExistingMBeanServerConnection method that gets the existing
connection.
Using this method might be a way to avoid the out of memory error.
Tom
On 9/21/2010 4:02 AM, Rupert Young (Restart) wrote:
>
> With the management API creation of a MBeanServerConnection,
>
> aconn = new AppserverConnectionSource(host, port, user, pass, null);
>
> mconn = aconn.getMBeanServerConnection();
>
> creates a new thread each time. If this in a loop it quickly results
> in an outofmemory error.
>
> How can the MBeanServerConnection be closed, there doesn't appear to
> be an appropriate method?
>
> Regards,
>
> Rupert Young
>
> Principal Architect
>
> *R*e*S*tart *C*onsulting Ltd
>
> Connecting the NHS
>
> *Ë** UK:* +44 1753 865879
>
> *Ë** UK:* +44 7795 480387
>
> http://www.restartconsulting.com
> <BLOCKED::http://www.restartconsulting.com>
>