In my previous article about Java Virtual Threads
I focused on different pinning cases caused by the synchronized
construct. Some of the presented cases were far
from being evident just by looking at the code. That’s why I believe that actively monitoring our apps for pinning is a must.
We don’t know if the pinning happens in our app if we’re not monitoring it. We don’t know how frequently it occurs. We don’t know for how long our treads are pinned. Without monitoring, we can only speculate about how pinning affects our application’s performance. IĀ prefer measuring than guessing.