mosn / holmes

self-aware Golang profile dumper
Apache License 2.0
1.06k stars 135 forks source link

一点小建议 #117

Closed Owen-Zhang closed 1 year ago

Owen-Zhang commented 1 year ago

var buf bytes.Buffer _ = pprof.Lookup("xxx").WriteTo(&buf, int(h.opts.DumpProfileType)) 几秒就要运行一次 此处的 buffer是否可以搞成复用呢,不然这样不停的分配,又不停的回收, 这会不会成为性能点, 可能理解的不对

taoyuanyuan commented 1 year ago

看着是需要满足dump的条件才会走到这个流程里面哟,除非是一直都内存高,一直高好像也是有汇总dump的,可以看看

Jun10ng commented 1 year ago

不会几秒dump一次,最极端场景下是每次 cooldown 一结束,立马dump一次。