what does anon-rss and total-vm mean

只愿长相守 提交于 2020-01-30 18:25:48

问题


Recently, tomcat process on my Linux machine was killed abruptly. After investigation I found below error message in /var/log/messages file:

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

Now, can someone please tell me that what all is included in total-vm and how is anon-rss different from rss?


回答1:


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.



来源:https://stackoverflow.com/questions/18845857/what-does-anon-rss-and-total-vm-mean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!