I profiled my code with both JProfiler and YourKit. However, I haven't been able to figure out how to detect which piece of code is responsible for high CPU load.
It's trivial to detect hot spots if the response time is bad. In my case though response time is not a problem. It's just that the CPU load is really high (surprisingly high) during the short time this particular request is processed.
How can I pin-point which class(es)/method(s) are causing this? I guess what I'm looking for is some kind of list which tells me how many CPU cycles the processing of a method required - or so.
CPU load essentially indicates the number of cpu cycles where the cpu had something to do instead of just twiddling virtual thumbs.
So if your request actually does real work (instead of waiting for disk I/O) then it is to be expected that the load goes high while the work is being done as the cpu has something to do.
The thing you need to look for is running out of cpu cycles as that is when the response times start climbing.
If your problem here is that the request is so short that the profiler cannot show you what you need to see, then consider using an automated tool to ask it to process hundreds of thousands of requests. This should help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With