VIRT 并不是表示进程所占用的内存,而是表示进程可以访问的内存空间,详见 What does Virtual memory size in top mean?
VIRT represents how much memory the program is able to access at the present moment.
github 上也有人提出过这个问题 High virtual memory usage on Ubuntu 16,得到的回答是:
please note that the high virtual memory usage is not an issue. It doesn't cost you anything (except for a bit of memory for the processor page tables), since this space is private to each process. So even if it was using hundreds of gigabytes of VM or more, it would still be ok.
感谢你的回答,我也有这个困惑,还有我也补充一个官方文档,解释为什么这种情况不是内存溢出,而且内存一般是75%左右:
引用:
- The default value, which only applies in certain cases, is the lesser of 20 MB or 75% of the memory limit on the container. The default value applies if:
- The process is running inside a container that has a specified memory limit.
- System.GC.HeapHardLimit is not set.
你的电脑内存真多!
8G内存,7G swap,但是swap一点没用上.但是这个数据太怪了吧,你们也是这样的吗?
这里是对应分配的虚拟内存地址,而不是占用的虚拟内存大小