[jboss-user] [Management, JMX/JBoss] - Re: How to know CURRENT HEAP SIZE USED, FREE HEAP SPACE, TOT

vijayneema do-not-reply at jboss.com
Mon Mar 31 04:52:43 EDT 2008

Thanks everyone!!

For your better understanding, here is the code I am using with weblogic to fetch the required information:

import weblogic.jndi.Environment;
  | import weblogic.management.MBeanHome;
  | import weblogic.management.runtime.JVMRuntimeMBean;
  | Environment env = new Environment();
  | env.setProviderUrl("t3://weblogicbox:1111");
  | env.setSecurityPrincipal("abcd");
  | env.setSecurityCredentials("abcd");
  | Context ctx = env.getInitialContext();
  | home = (MBeanHome) ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
  | JVMRuntimeMBean serverRuntime = (JVMRuntimeMBean) home.getRuntimeMBean(serverName, "JVMRuntime");
  | System.out.println((serverRuntime.getHeapSizeCurrent()-serverRuntime.getHeapFreeCurrent())/1024);

Note that this program is running on a different box & fetching information from a different box running weblogic.

Thanks a lot

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140026#4140026

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4140026

More information about the jboss-user mailing list