Re: Monitoring Memory Usage

2008-08-15 Thread Kevan Miller
On Aug 13, 2008, at 2:20 PM, Jarek Gawor wrote: On Wed, Aug 13, 2008 at 2:08 PM, Peter L. Berghold <[EMAIL PROTECTED]> wrote: As of yet I haven't been able to catch it in the act to know for sure what I have. I'm monitoring in things manually right now and I'm not seeing more than 40K out of

Re: Monitoring Memory Usage

2008-08-13 Thread Jarek Gawor
On Wed, Aug 13, 2008 at 2:08 PM, Peter L. Berghold <[EMAIL PROTECTED]> wrote: > > As of yet I haven't been able to catch it in the act to know for sure > what I have. I'm monitoring in things manually right now and I'm not > seeing more than 40K out of 512Mb being used with about a dozen users > lo

Re: Monitoring Memory Usage

2008-08-13 Thread Peter L. Berghold
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kevan Miller wrote: > I assume you're seeing infinitely increasing memory usage and this is > not simply a matter of bumping up your max heap or permgen memory. > As of yet I haven't been able to catch it in the act to know for sure what I have. I'

Re: Monitoring Memory Usage

2008-08-13 Thread Kevan Miller
On Aug 13, 2008, at 12:55 PM, Peter L. Berghold wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Peter L. Berghold wrote: Trygve Hardersen wrote: Sorry, it's java.lang.Runtime, no import needed :) That's all well and good (and fun to play with) but I'm hoping to get the same info tha

Re: Monitoring Memory Usage

2008-08-13 Thread Donald Woods
We use the JSR77 code to get the stats, which you can also use JMX to retrieve -Donald Peter L. Berghold wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Peter L. Berghold wrote: Trygve Hardersen wrote: Sorry, it's java.lang.Runtime, no import needed :) That's all well and good

Re: Monitoring Memory Usage

2008-08-13 Thread Trygve Hardersen
I'm not a Geronimo committer, but I believe the relevant code is in org.apache.geronimo.console.jsr77.Jsr77Lookup: public DynamicServerInfo getJavaVMStatistics() { HttpSession session = WebContextFactory.get().getSession(true); ManagementHelper helper = PortletManager.getManage

Re: Monitoring Memory Usage

2008-08-13 Thread Peter L. Berghold
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Peter L. Berghold wrote: > Trygve Hardersen wrote: >> Sorry, it's java.lang.Runtime, no import needed :) > That's all well and good (and fun to play with) but I'm hoping to get the same info that the console gives you pictorially. I'm going to this

Re: Monitoring Memory Usage

2008-08-13 Thread Peter L. Berghold
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Trygve Hardersen wrote: > Sorry, it's java.lang.Runtime, no import needed :) > That's what I thought but I asked (never assume) because for all I know there's another Runtime class buried in the Tomcat API somewhere... - -- Peter L. Berghold h

Re: Monitoring Memory Usage

2008-08-13 Thread Trygve Hardersen
Sorry, it's java.lang.Runtime, no import needed :) See http://java.sun.com/javase/6/docs/api/java/lang/Runtime.html Trygve 2008/8/13 Peter L. Berghold <[EMAIL PROTECTED]> > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Trygve Hardersen wrote: > > What about: > > > > Runtime rt = Runtime.g

Re: Monitoring Memory Usage

2008-08-13 Thread Peter L. Berghold
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Trygve Hardersen wrote: > What about: > > Runtime rt = Runtime.getRuntime(); > long free = rt.maxMemory() - (rt.totalMemory - rt.freeMemory()); > What are you importing to get the Runtime class? - -- Peter L. Berghold http://www.berghold.net

Re: Monitoring Memory Usage

2008-08-13 Thread Trygve Hardersen
What about: Runtime rt = Runtime.getRuntime(); long free = rt.maxMemory() - (rt.totalMemory - rt.freeMemory()); I've been using this (with Tomcat, not Geronimo), and while it's not perfect it gives you an idea of the JVM memory consumption. Trygve 2008/8/13 Peter L. Berghold <[EMAIL PROTECTED]>

Monitoring Memory Usage

2008-08-13 Thread Peter L. Berghold
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Is there a way to programmatically extract from a running Geronimo instance it's memory usage? Reason I'm asking is I'd like to write a Nagios plugin for this to provide alarms when the JVM runs out of memory. - -- Peter L. Berghold http://www.