Re: How to get memory statistics from a remote Geronimo runtime?

2007-12-07 Thread Matt Hogstrom
On Dec 5, 2007, at 4:29 AM, Vamsavardhana Reddy wrote: On Dec 4, 2007 11:23 PM, Anita Kulshreshtha [EMAIL PROTECTED] wrote: It is not clear to me if this is part of the earlier code or a separate program. If it is part of the JMX code, then Runtime is from the local jvm not remote. The

Re: How to get memory statistics from a remote Geronimo runtime?

2007-12-07 Thread Vamsavardhana Reddy
On Dec 7, 2007 9:38 PM, Matt Hogstrom [EMAIL PROTECTED] wrote: On Dec 5, 2007, at 4:29 AM, Vamsavardhana Reddy wrote: On Dec 4, 2007 11:23 PM, Anita Kulshreshtha [EMAIL PROTECTED] wrote: It is not clear to me if this is part of the earlier code or a separate program. If it is

Re: How to get memory statistics from a remote Geronimo runtime?

2007-12-05 Thread Vamsavardhana Reddy
On Dec 4, 2007 11:23 PM, Anita Kulshreshtha [EMAIL PROTECTED] wrote: It is not clear to me if this is part of the earlier code or a separate program. If it is part of the JMX code, then Runtime is from the local jvm not remote. The non heap Memory for this program in either case is

Re: How to get memory statistics from a remote Geronimo runtime?

2007-12-04 Thread Anita Kulshreshtha
If you are interested in usedMemory and maxMemory as given by Runtime, we could add that again. The JVM Stats give a rough estimate of heap memory only. Thanks Anita --- Vamsavardhana Reddy [EMAIL PROTECTED] wrote: I am wondering if the following (which works) is the correct way to get

Re: How to get memory statistics from a remote Geronimo runtime?

2007-12-04 Thread Vamsavardhana Reddy
I don't know if it is necessary to add the statistics from Runtime. Here is the relationship I see between the stats from Runtime and those got from MemoryMXBean.getHeapMemoryUsage() Runtime.totalMemory() == MemoryUsage.getCommitted() Runtime.maxMemory() == MemoryUsage.getMax()

Re: How to get memory statistics from a remote Geronimo runtime?

2007-12-04 Thread Anita Kulshreshtha
IIUC, http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/MemoryMXBean.html runtime values are sum of values from Heap and non heap memory. In other words you need to add contribution from non heap Memory to all 4 equations. Thanks Anita --- Vamsavardhana Reddy [EMAIL PROTECTED]

Re: How to get memory statistics from a remote Geronimo runtime?

2007-12-04 Thread Vamsavardhana Reddy
I don't know why the non heap memory is missing in the equations. The equations I gave are based what I observed by running the following code. MemoryMXBean memmxbean = ManagementFactory.getMemoryMXBean(); Runtime rt = Runtime.getRuntime(); MemoryUsage

Re: How to get memory statistics from a remote Geronimo runtime?

2007-12-04 Thread Anita Kulshreshtha
It is not clear to me if this is part of the earlier code or a separate program. If it is part of the JMX code, then Runtime is from the local jvm not remote. The non heap Memory for this program in either case is negligible. You could start G with -Dcom.sun.management.jmxremote. Start

Re: How to get memory statistics from a remote Geronimo runtime?

2007-12-04 Thread Vamsavardhana Reddy
On Dec 4, 2007 11:23 PM, Anita Kulshreshtha [EMAIL PROTECTED] wrote: It is not clear to me if this is part of the earlier code or a separate program. If it is part of the JMX code, then Runtime is from the local jvm not remote. The non heap Memory for this program in either case is

How to get memory statistics from a remote Geronimo runtime?

2007-12-03 Thread Vamsavardhana Reddy
I am wondering if the following (which works) is the correct way to get maxHeapSize and usedMemory from a remote Geronimo server. import org.apache.geronimo.management.stats.BoundedRangeStatisticImpl; Map map = new HashMap(); map.put(jmx.remote.credentials, new String[] {user,

Re: How to get memory statistics from a remote Geronimo runtime?

2007-12-03 Thread Viet Nguyen
You can do it that way or do it the JSR-77 way. Properties props = new Properties(); props.setProperty(Context.INITIAL_CONTEXT_FACTORY, org.apache.openejb.client.RemoteInitialContextFactory); props.setProperty(Context.PROVIDER_URL, ejbd://localhost:4201);

Re: How to get memory statistics from a remote Geronimo runtime?

2007-12-03 Thread Vamsavardhana Reddy
That worked too. Thanks. ++Vamsi On Dec 4, 2007 12:29 AM, Viet Nguyen [EMAIL PROTECTED] wrote: You can do it that way or do it the JSR-77 way. Properties props = new Properties(); props.setProperty(Context.INITIAL_CONTEXT_FACTORY,