tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Singleton <p...@jbgb.com>
Subject Re: Does anyone have an approach to checking if Tomcat instance is UP?
Date Tue, 21 Aug 2007 12:49:27 GMT
Jeff Hoffmann wrote:
> Christopher Schultz wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Dan,
>>
>> Dan Armbrust wrote:
>>> A simple cron job that points to a URL using lynx, and greps the
>>> output for what it should see will do the trick...
>>
>> I would use wget instead of Lynx, but that's just me.
>>
>> Don't forget that the OP said that his JSPs appear to run correctly even
>> after the OOME.
> 
> If what you're concerned about is an OOME, you can have a JSP that 
> queries the runtime memory usage and outputs something easily parsable 
> to alert you to a (pending) problem.  IE:
> 
> Runtime rt = Runtime.getRuntime();
> double used = rt.totalMemory()-rt.freeMemory();
> double free = rt.freeMemory();
> double available =  rt.maxMemory()-rt.totalMemory();
> double usedpercent = (used/rt.maxMemory()) * 100;
> double freepercent = (free/rt.maxMemory()) * 100;
> double availablepercent = (available/rt.maxMemory()) * 100;

Thanks for this - is there a similar (or any) way to
anticipate "out of PermGen"?

Paul S.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message