Go 占用虚拟内存过高

Go Linux About 320 words

问题

Linux系统中使用top命令发现VIRT列占用了700M

解答

Go内存分配器在虚拟内存中预留了一大块区域作为分配的地方。这块虚拟内存局部于具体的Go进程, 而这种预留并不会剥夺内存中的其它进程。

查看Go内存时间占用可查看top命令的RES列(Linux)或RSIZE列(Mac OS X

相关名词

VIRTvirtual memory usage虚拟内存

RESresident memory usage常驻内存

SHRshared memory共享内存

参考

https://golang.org/doc/faq#Why_does_my_Go_process_use_so_much_virtual_memory

Views: 5,532 · Posted: 2020-10-28

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh