Thursday, February 25, 2016

oom-killer - anon-rss and total-vm


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

Jan 21 15:58:14 msdc02 kernel: Out of memory: Kill process 35864 (process1) score 926 or sacrifice child
Jan 21 15:58:14 msdc02 kernel: Killed process 35864, UID 0, (process1) total-vm:41163224kB, anon-rss:31795776kB, file-rss:92kB

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).

If you open a huge file in vim, the file-rss would be high, on the other size, 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.

vm.overcommit_memory = 2
vm.overcommit_ratio = 80

No comments:

Post a Comment