<p>I just profiled a program of mine to see what functions are responsible for the most allocation (as the cpu profiling revealed that mallocgc was one of the top time hogs) and got this as the output:</p>
<pre><code>runtime.oneNewExtraM /cs/local/lib/pkg/go-1.9.2/src/runtime/proc.go
</code></pre>
<p>As being responsible for 100% of the allocating. I would have expected to see one of my own functions in the top 5 or 10 at least. Does anyone know what might be causing oneNewExtraM to be handling all this allocation?</p>
<hr/>**评论:**<br/><br/>dgryski: <pre><p>M's are real actual machine threads. Are you doing a lot of syscalls or cgo calls ?</p></pre>ConfuciusBateman: <pre><p>Hmm. Would using the md5 package potentially cause this? The Write and Sum methods get used a ton in about 25 goroutines that my program spawns. Would you recommend trying to go through my program and seeing what might be making syscalls/cgo calls?</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
0 回复
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传