KVM: Cannot allocate memory - although enough memory available

BelCloud

Renowned Member
Dec 15, 2015
96
5
73
www.belcloud.net
I've started having this error recently when i try to start a KVM. The server has enough memory available, although it seems to be used in cache.
Code:
ioctl(KVM_CREATE_VM) failed: 12 Cannot allocate memory
kvm: failed to initialize KVM: Cannot allocate memory
Code:
# free m
              total        used        free      shared  buff/cache   available
Mem:      131984580    96187148     1309032       57512    34488400    34157352
Swap:      16777212      686336    16090876

I can resolve it temporarly by using
Code:
echo 1 > /proc/sys/vm/compact_memory

I'm using LVM over a hw raid card, there's no zfs involved.

Does anyone have any idea on how to permanently fix it?
 
The machine runs as a single proxmox node.
128gb ram
Ballooning device is enabled, but i'm using minimum memory = memory



One idea would be that i'm using writethrough for VM disk cache and that would increase the ram cache making the VM unable to start.
 
Last edited: