douqian2334 2016-03-08 15:26
浏览 244
已采纳

解释pprof堆图

When I profile the heap in go with pprof I get the following:

enter image description here

However, I'm not clear on how to interpret that visualization. In particular:

"The memory next to the arrows means _____ and the memory inside of a box means ______. So when a box has multiple arrows from it, it means _____, and when it has multiple arrows to it, it means _____".

  • 写回答

1条回答 默认 最新

  • duannaikuang1301 2016-03-08 16:24
    关注
    1. the perceived cumulative memory consumption of this function including all of its subfunctions
    2. the perceived memory consumption of this function excluding all of its subfunctions
    3. that it calls multiple subfunctions
    4. that multiple functions call it

    No difference between the meaning of the arrows between the heap and the CPU profiling mode.

    You may be interested in the output of the top pprof command, which can give you results in the following form:

    9701.61kB of 9701.61kB total (  100%) Dropped 112 nodes (cum <=
    48.51kB) Showing top 10 nodes out of 29 (cum >= 3611.54kB)
          flat  flat%   sum%        cum   cum%
     4549.72kB 46.90% 46.90%  4549.72kB 46.90%  mystery.function
     2587.52kB 26.67% 73.57%  2587.52kB 26.67%  reflect.unsafe_NewArray
     1024.02kB 10.56% 84.12%  1024.02kB 10.56%  encoding/xml.copyValue
         514kB  5.30% 89.42%      514kB  5.30%  compress/gzip.NewReader
         514kB  5.30% 94.72%      514kB  5.30%  net/http.(*Transport).dialConn
      512.34kB  5.28%   100%   512.34kB  5.28%  runtime.makeslice
             0     0%   100%      514kB  5.30%  bytes.(*Buffer).ReadFrom
             0     0%   100%  3611.54kB 37.23%  encoding/xml.(*Decoder).Decode
             0     0%   100%  3611.54kB 37.23%  encoding/xml.(*Decoder).DecodeElement
             0     0%   100%  3611.54kB 37.23%  encoding/xml.(*Decoder).unmarshal
    

    And here are (IMHO) the two best references for Go heap profiling with pprof:

    1. https://google-perftools.googlecode.com/svn/trunk/doc/heapprofile.html
    2. https://software.intel.com/en-us/blogs/2014/05/10/debugging-performance-issues-in-go-programs
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染