0

I am observing (based on logs) that my (java) process pauses for something during execution. My first guess is a context switch. In order to verify I am trying to find (a) the number of involuntary context-switches that my process incurs, and (b) the amount of time the process spends in the run queue (ready to run but waiting to be scheduled).

Are there any tools to gather this information. I am running kernel 2.6.18 (centos 5) and 2.6.32 (centos6).

Sumit
  • 121
  • 3

1 Answers1

0

To view the context switch behavior in the OS, use:

vmstat 2 200

When the app server starts and you see the context switching climb, then your theory is correct. To see the details around those context switches in detail, you may wish to use VisualVM. This will give you a much more detailed view around the threads, hand-off time, what it is waiting for and much more.

Aaron
  • 2,809
  • 2
  • 11
  • 29