How do I find top 10 or top few CPU intensive thread stack traces created by Java process in Linux ? I would like to know how much time spent as well if possible
Standard linux tool like top
will just give top processes, which are consuming the most cpu. but will not be able to tell that what all the threads inside a single java process
is taking most of the cpu.
You need a profiling tool like YourKit
to determine what threads in java process is using most of the cpu and you can enable trace based sampling in yourkit
to even get the invocation count
of a method as well.
please refer https://www.yourkit.com/docs/java/help/cpu_intro.jsp doc , on how to get started with CPU profiling
using yourkit.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.