helloworld12
V2EX  ›  问与答

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

  •  
  •   helloworld12 · Jan 13, 2018 · 4130 views
    This topic created in 3054 days ago, the information mentioned may be changed or developed.
    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 replies    2018-01-13 13:50:14 +08:00
    jameshuazhou
        1
    jameshuazhou  
       Jan 13, 2018
    这问题没头没尾的
    helloworld12
        2
    helloworld12  
    OP
       Jan 13, 2018
    @jameshuazhou 懂得 golang pprof 的看得懂
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1077 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 18:17 · PVG 02:17 · LAX 11:17 · JFK 14:17
    ♥ Do have faith in what you're doing.