From remote am monitoring MBeans of JBoss in every 5 minutes interval. In my code am creating a new "Management" object within a thread(in run method) like the below in every interval. And am creating more than one thread.
Object obj = context.lookup( "ejb/mgmt/MEJB" ); ManagementHome home = (ManagementHome) PortableRemoteObject.narrow(obj,ManagementHome.class); Management server = home.create(); //after that am executing the query like below Set mbeanSet=server.queryNames(queryObj,null);
Why not calling server.remove() after each iteration, or just caching the server reference???