Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to find the number of threads running in Java with the task manager?

In Java, suppose if I start 1000 threads with a loop as below, is there any way I can monitor the number of threads actually running and the CPU resources that the threads consume with task manager?

for(int j=0; j<=1000; j++)
{
    MyThread mt = new MyThread ();
    mt.start ();
}
like image 976
Deepak Avatar asked Aug 21 '12 11:08

Deepak


1 Answers

You can use VisualVM or JConsole or any other monitoring tool

like image 71
Cratylus Avatar answered Oct 20 '22 23:10

Cratylus