You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Haase, Johannes | SCARUS" <j....@scarus.de> on 2009/04/01 08:46:49 UTC

Re: Profiling tomcat applications with -Xrunhprof (Tomcat runs asa Windows Service)


Caldarale, Charles R schrieb:
>> From: Caldarale, Charles R
>> Subject: RE: Profiling tomcat applications with -Xrunhprof (Tomcat runs
>> asa Windows Service)
>>
>> What might work is using JVisualVM instead and just looking at the
>> information in the GUI.
>>     
>
> I did get JVisualVM to work with Tomcat running as a service, but I don't think you're going to like it (to paraphrase Douglas Adams).
>
> First, the Tomcat service needs to be running under the same Windows account that JVisualVM is started with; JVisualVM cannot find the PID otherwise, and heap profiling doesn't seem to be available through JMX ports (or maybe I just don't know how to configure it).
>
> Second, you'll need to run Tomcat under JRE/JDK 1.6.  JVisualVM can access Tomcat running under a 1.5 JRE, but heap profiling won't be available.
>
> So, the easiest thing may well be to just run Tomcat from the command prompt for the duration of the profiling effort.  Since heap profiling has a significant performance impact, you wouldn't want it on very long anyhow.
>
>  - Chuck
>   

Hello Chuck!

Thanks for clarification.
How can I start the tomcat 5.5 that was installed and intended to run as 
a service via console?

Thanks a lot!
Johannes

>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>
>   

-- 
Johannes Haase


SCARUS GmbH & Co. KG
E3, 13
68159 Mannheim

Tel.: +49-(0)621-761926-11
Fax: +49-(0)621-761926-59
Mobile: +49-(0)151-56314777

www.scarus.de <http://www.scarus.de/>

USt.-ID DE 237062963 * Amtsgericht Ludwigshafen HRA 3884
Geschäftsführer: Matthias Ulrich & Christoph Kurek

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige 
vertrauliche Informationen enthalten. Sollten Sie diese E-Mail 
irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, 
eine Vervielfältigung oder Weitergabe ausdrücklich untersagt. Bitte 
benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen 
Dank.

This e-mail may contain trade secrets or privileged, undisclosed or 
otherwise confidential information. If you have received this e-mail in 
error, you are hereby notified that any review, copying or distribution 
of it is strictly prohibited. Please inform us immediately and destroy 
the original transmittal. Thank you for your cooperation.

RE: Profiling tomcat applications with -Xrunhprof (Tomcat runs asa Windows Service)

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Haase, Johannes | SCARUS [mailto:j.haase@scarus.de]
> Subject: Re: Profiling tomcat applications with -Xrunhprof (Tomcat runs
> asa Windows Service)
> 
> How can I start the tomcat 5.5 that was installed and intended 
> to run as a service via console?

Look in Tomcat's bin directory; if you have startup.bat and shutdown.bat scripts, use those.  If you don't have them, download the .zip package of Tomcat, expand it, and copy all the bin/*.bat files into your existing bin directory.  (The .exe package omits the scripts, for inexplicable reasons.)

Once that's done, open up a command prompt window, set JAVA_HOME to your JDK location (or JRE_HOME to your JRE), set CATALINA_OPTS to whatever JVM command-line parameters you need, and run startup.bat.  Note that none of your config settings from tomcat5w.exe are used automatically; you have to supply them via CATALINA_OPTS, including heap sizes.  The Tomcat process will start in a separate window.  Use shutdown.bat from the original commmand prompt window to terminate it.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.