Out of memory. What process to kill?

nwongrat

Member
Feb 16, 2023
34
0
6
I was running 2 VMs. One of them is TRUENAS Scale. The other was our own software. I notice that when I configure vm guess to use 96% of memory (in my case 31G out of 32G). One of the VMs will die eventually. Below is the log.

Feb 19 19:36:30 pxm-03 kernel: oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=qemu.slice,mems_allowed=0,global_oom,task_memcg=/qemu.slice/3234.scope,task=kvm,pid=22488,uid=0
Feb 19 19:36:30 pxm-03 kernel: Out of memory: Killed process 22488 (kvm) total-vm:25470416kB, anon-rss:24628292kB, file-rss:2160kB, shmem-rss:4kB, UID:0 pgtables:48888kB oom_score_adj:0

Question is in what condition that proxmox choose to kill the VMs? For instance kill lower ID first?

Thank you for your reply.
 
The Linux OOM killer will decide which process to kill. It takes quite some parameters into account, so making a prediction isn't that easy.

Do I understand it correctly, that your host has 32G of memory and you assigned 31G to a single VM? That is not a good idea! CPU cores can usually be overprovisioned quite easily (unless you run CPU intensive VMs), but RAM should not be overprovisioned!
 
Do I understand it correctly, that your host has 32G of memory and you assigned 31G to a single VM?
No. There were 2 VMs. One was TRUENAS 23G and another was 7.9G. This is not the first time. The process was killed randomly in my point of view. Regarding your reply. The best way might be provision at 80% of RAM for total VMs.

Thank you.
 
In my limited experience, OOM tends to kill the process with the largest allocation first, which will typically be a VM: the VM with 24G in your case. Note that the manual specifies that Proxmox itself also requires at least 1 or 2GB.
 
In my limited experience, OOM tends to kill the process with the largest allocation first, which will typically be a VM: the VM with 24G in your case. Note that the manual specifies that Proxmox itself also requires at least 1 or 2GB.
That does explain why TRUENAS always be the first blood!!