V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
helloworld12
V2EX  ›  问与答

golang gc 这种情况是否是需要优化内存?

  •  
  •   helloworld12 · 2018-01-13 11:18:21 +08:00 · 3416 次点击
    这是一个创建于 2539 天前的主题,其中的信息可能已经有所发展或是发生改变。
    Time: Jan 13, 2018 at 11:14am (CST)
    Duration: 30.11s, Total samples = 12.17s (40.41%)
    Entering interactive mode (type "help" for commands, "o" for options)
    (pprof) top
    Showing nodes accounting for 6170ms, 50.70% of 12170ms total
    Dropped 281 nodes (cum <= 60.85ms)
    Showing top 10 nodes out of 170
          flat  flat%   sum%        cum   cum%
        1370ms 11.26% 11.26%     1370ms 11.26%  runtime.futex /usr/local/go/src/runtime/sys_linux_amd64.s
        1310ms 10.76% 22.02%     2960ms 24.32%  runtime.scanobject /usr/local/go/src/runtime/mgcmark.go
         880ms  7.23% 29.25%      880ms  7.23%  runtime.heapBitsForObject /usr/local/go/src/runtime/mbitmap.go
         480ms  3.94% 33.20%      480ms  3.94%  runtime.usleep /usr/local/go/src/runtime/sys_linux_amd64.s
         420ms  3.45% 36.65%      420ms  3.45%  runtime.greyobject /usr/local/go/src/runtime/mgcmark.go
         410ms  3.37% 40.02%      420ms  3.45%  runtime.mapiternext /usr/local/go/src/runtime/hashmap.go
         390ms  3.20% 43.22%     1330ms 10.93%  runtime.mapassign_faststr /usr/local/go/src/runtime/hashmap_fast.go
         330ms  2.71% 45.93%      660ms  5.42%  runtime.makemap /usr/local/go/src/runtime/hashmap.go
         300ms  2.47% 48.40%      310ms  2.55%  syscall.Syscall /usr/local/go/src/syscall/asm_linux_amd64.s
         280ms  2.30% 50.70%      500ms  4.11%  runtime.selectgo /usr/local/go/src/runtime/select.go
    

    看着 cpu 最高的都是scanobject

    请教下,谢谢

    2 条回复    2018-01-13 13:50:14 +08:00
    jameshuazhou
        1
    jameshuazhou  
       2018-01-13 12:41:48 +08:00
    这问题没头没尾的
    helloworld12
        2
    helloworld12  
    OP
       2018-01-13 13:50:14 +08:00
    @jameshuazhou 懂得 golang pprof 的看得懂
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   991 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 21:50 · PVG 05:50 · LAX 13:50 · JFK 16:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.