On Oct 29, 2012, at 12:39 PM, Ravi Joshi wrote:

> To get the number of live threads, previously i was using JConsole, which was 
> pointing to tomcat PID. but it looks like JConsole is not updating the graphs 
> fastly.

How fast do you need the graphs updated?  How fast are you seeing the graphs 
updated?

> My aim is just to know the number of active threads in tomcat6. Is there any 
> command/way to get the number of live threads in tomcat 6? My tomcat is 
> running on RHEL6 64bit server.

There are a few tools, the best choice depends on exactly what you are trying 
to do.  

   1.) You could use JVisualVM.  It's a GUI similar to Jconsole, but better.
   2.) You could use "top -H".  This usually helps when you need to see 
resource usage by thread.
   3.) You could use a profiler like YourKit.  This will likely provide the 
most detail about the threads.
   4.) You could use the "jstack" command.  This would generate a thread dump, 
you could then grep that to count the number of threads.  Wouldn't recommend 
doing this too often though, it would affect the performance of your JVM.

Might be some other ways too.  Hopefully one of these will work though.

Dan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to