title: How to get memory usage of tomcat 7 using JMX API?
body: <p>Is it possible to get the memory usage statistics of a tomcat server using JMX API. Which Mbean can provide me this info? I am stuck at the formation of ObjectName in the below code </p>
  
  <pre><code>JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:2020/jmxrmi");
  JMXConnector jmxc = JMXConnectorFactory.connect(url);
  MBeanServerConnection server = jmxc.getMBeanServerConnection();
  
    Object o = jmxc.getMBeanServerConnection().getAttribute(
            new ObjectName("-----"); 
  </code></pre>
  
  <p>Wonder how jconsole draws the memory graphs, any pointers for the source code?</p>