简体   繁体   中英

Find CPU time spend context switching or waking up threads in JVM

I have a multi-threaded application running on a JVM. I would like to know the % CPU time spend on context switching/waking up of threads by the application. The OS in use is GNU/Linux and OSX.

Can I figure it out by profiling the application? If yes, what method should I be looking at that corresponds to context switch time in the profiler output?

You're asking a linux question, not a java one. I don't think the JVM has insight into non-voluntary context switches.

This will give you context switch rates for a particular process.

pidstat -w -p <pid>

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM