java loads almost half of the processor. I wonder if you can somehow find out the list of processes running in java. Overloaded tomcat - does not help.

1 answer 1

  1. Connect to the JVM process using jconsole or jvisualvm tools. We get the opportunity to see online all the streams.
  2. We dump the JVM process threads using the jstack utility ( http://docs.oracle.com/javase/7/docs/technotes/tools/share/jstack.html). Get information about all the threads at the time of the dump.

PS Loads half of the processor is not Java, but the executable code of the application. See where JVM spends the most time, in threads executing logic or in a GC flow. Look at the schedule of the GC. Is the collector running too often and does it release a lot of memory each time? Enable GC logging ( http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html#DebuggingOptions). Isn't garbage collection taking too much time? Next, make a conclusion about who mainly consumes CPU - the main logic or GC. Optimize the most resource-intensive part. Repeat the process iteratively to achieve the desired result.

PPS There is also Java Mission Control. But he did not try.