[心缘地方]同学录
首页 | 功能说明 | 站长通知 | 最近更新 | 编码查看转换 | 代码下载 | 常见问题及讨论 | 《深入解析ASP核心技术》 | 王小鸭自动发工资条VBA版
登录系统:用户名: 密码: 如果要讨论问题,请先注册。

[备忘]进程被杀,total-vm和anon-rss的意思

上一篇:[备忘]swing支持拖拽,获取文件路径
下一篇:[备忘]PostgreSQL与JAVA JDBC数据类型对照表

添加日期:2021/10/13 14:22:24 快速返回   返回列表 阅读1051次
命令:
grep "Out of memory" /var/log/messages
egrep -i -r 'killed process' /var/log
可以查看进程被kill的日志,如:
---------------------------------
kernel: [1799319.246494] Out of memory: Kill process 28536 (java) score 673 or sacrifice childSep 
kernel: [1799319.246506] Killed process 28536 (java) total-vm:1271568kB, anon-rss:426528kB, file-rss:0kB
---------------------------------
total-vm是申请使用的空间,anon_rss是实际使用的内存,file-rss是跟文件相关的内存
---------------------------------
据我了解,进程使用的虚拟内存的大小列为" total-vm"。 它的一部分实际上已映射到RAM本身(已分配和使用)。 这是" RSS"。

RSS的一部分分配在实内存块中(而不是映射到文件或设备中)。 这是匿名内存(" anon-rss"),并且还有RSS内存块被映射到设备和文件(" file-rss")中。

因此,如果您在vim中打开一个巨大的文件,则文件rss会很高,另一方面,如果您malloc()大量内存并真正使用它,那么您的anon-rss也会很高。

另一方面,如果您分配了大量空间(使用malloc()),但从未使用过,则total-vm会更高,但不会使用实际内存(由于内存过量使用),因此, rss值会很低。

As I understand, the size of the virtual memory that a process uses is listed as "total-vm". Part of it is really mapped into the RAM itself (allocated and used). This is "RSS".

Part of the RSS is allocated in real memory blocks (other than mapped into a file or device). This is anonymous memory ("anon-rss") and there is also RSS memory blocks that are mapped into devices and files ("file-rss").

So, if you open a huge file in vim, the file-rss would be high, on the other side, if you malloc() a lot of memory and really use it, your anon-rss would be high also.

On the other side, if you allocate a lot of space (with malloc()), but nevers use it, the total-vm would be higher, but no real memory would be used (due to the memory overcommit), so, the rss values would be low.
 

评论 COMMENTS
没有评论 No Comments.

添加评论 Add new comment.
昵称 Name:
评论内容 Comment:
验证码(不区分大小写)
Validation Code:
(not case sensitive)
看不清?点这里换一张!(Change it here!)
 
评论由管理员查看后才能显示。the comment will be showed after it is checked by admin.
CopyRight © 心缘地方 2005-2999. All Rights Reserved