Profiled app with YourKit, still can't identify the CPU hog

后端 未结 5 649
醉话见心
醉话见心 2020-12-19 17:45

I\'ve got a Java application that is consuming 100% of the CPU most of the time (as indicated by cacti and top monitoring). We fired up YourKit (which confirms the CPU resou

5条回答
  •  一整个雨季
    2020-12-19 18:05

    I would turn on memory tracing AND cpu profiling and look at the cpu profiler again. This will show up different areas to optimise.

    When you say its using 100% of a CPU can you look at whether it is in the user or system/kernel space. e.g. top. The profiler won't show you cpu used in the kernel space.

    How many threads do you have? If you have enough idle threads, you can have more than 100% CPU just switching between them. (You would have to have many thousands)

    Like similar answers, it is quite likely you application has so much overhead e.g. reading socket, swapping between threads, performing GCs that its not doing much real work. The profilers aren't so good at picking up overhead.

提交回复
热议问题