1

I am profiling java server . I am looking at the flame graph : http://www.brendangregg.com/flamegraphs.html . I have couple of questions on how to interpret flame profile . I am new to java, so they may sound very basic.

1) in the profile , the top frame i observe libjvm_so takes 38.6% cpu. Is this normal in java process and server ? What exactly is this shared object and is it usual that it takes so much of the processing ?

2) What does a it mean for function/stack to take x% . Is this relative or absolute ? x% of the total cpu usage by process or x% cpu. This brings me to my second question, when i compare 2 flame graphs , is comparing normalized by over all cpu usage of the process ? that is if a method takes 10% in one profile and takes 15% in another profile, does it mean the function is actually consuming more cpu. Or can it be the case the initial process the overall cpu usage was 50% but in the second process the cpu usage was 30% , so in absolute terms the second profile shows decreased cpu usage for the function. ( 10% of 50% is greater than 15% of 30%).

user179156
  • 841
  • 9
  • 31

1 Answers1

1

For question 1:

I think libjvm.so includes time spent doing compilation and garbage collection. If the process's CPU utilization is high and the process has been running for a while, spending a large amount of CPU time in libjvm.so is probably not generally expected, so might indicate a process is spending more time in GC or compilation than expected. If the profile was collected when the process was starting up (and so more time was devoted to compilation) this might be expected.

For question 2:

Percentages in the flame graphs generally refer to the a percentage of the total CPU used by the process. So, if the profile shows 5s of CPU time total, a method using 1s of CPU time would be shown as using 20% of all CPU time used.

CPU profiles collected by Stackdriver Profiler are collected over a 10s duration, and that can be used to understand the percentage of CPU used by a process. For example, a profile with a 5s total was collected when the process was using ~50% of a CPU.

For profile comparison in Stackdriver Profiler, the flame graph is colored by the absolute difference between CPU usage in the two profiles. Both absolute differences, and differences in percentage of total are reported in the tool tip.

A high level overview of flame graphs is documented here.

(Disclosure: I work on Stackdriver Profiler at Google)

Kalyana C
  • 23
  • 4
nolanmar511
  • 116
  • 4