Any number of things can cause high CPU usage, including frequent garbage collection, heavy data processing, or infinite loops in your code structure. Identifying the cause of a CPU spike often requires taking thread dumps and analyzing an enormous amount of raw data. Instead, APM Insight's thread profiling feature helps you to narrow down the root cause of CPU spikes by identifying the most time-consuming threads.
With on-demand thread profiling, you can easily identify time-consuming threads along with their thread ID, CPU time, and memory details, as well as the invocation count of every method. These details help you pinpoint which methods are causing an increase in CPU usage.