Am monitoring a java application for thread lock scenario,
In visualvm under monitor tab,
Live threads : 112 Live Peak : 126 Daemon thread : 99 Total started : 135,742
What does this mean? I feel its not right to have so much total started threads count. Is there any optimal number for thread creation? Am new to java programming . please help
Make sure that your program is using ThreadPool, which will make efficient use of threads.
The total thread count is number of threads started since the JVM is started. Live threads started(peak) is 126 threads so this looks normal & current live thread count is 112 this include all the threads Daemon/non-daemon threads not just started by your program but by JVM as well.
What does it mean by each count:
Live threads: This shows the current number of live/active threads including both daemon and non-daemon threads(Currently running).
Live Peak: This gives the peak count of live threads since the Java virtual machine started or peak was reset.
Daemon Threads: This gives the current number of live daemon threads.
Total Threads: This gives the total number of threads created and also started since the Java virtual machine started.