Stuck with SolusVM: Cannot Allocate Memory Error? We can help you.
Recently, one of our customers came across a “cannot allocate memory” error. This can happen while we boot KVM VPS in SolusVM.
As part of our Server Management Services, we assist our customers with several SolusVM queries.
Today, let us discuss how we can resolve this error easily.
What is SolusVM: Cannot Allocate Memory Error?
It is quite common that users experience that they are unable to boot KVM VPS in SolusVM.
In such situations, we often notice that the KVM VPS does not start in SolusVM – VPS stays offline.
In addition, we come across either of the below errors, if we press the Reboot (Debug) button on the page, SolusVM > Virtual Servers > the affected VPS.
qemu-kvm: cannot set up guest memory ‘pc.ram’: Cannot allocate memory
Or
Domain kvm101 has been undefined Domain kvm101 defined from /home/kvm/kvm101/kvm101.xml Domain kvm101 marked as autostarted error: Failed to create domain from /home/kvm/kvm101/kvm101.xml error: internal error: qemu unexpectedly closed the monitor: ioctl(KVM_CREATE_VM) failed: 12 Cannot allocate memory 2021-03-23T08:56:18.128294Z qemu-kvm: failed to initialize KVM: Cannot allocate memory
These errors mean we do not have enough memory on the node. This can be due to cache.
Often, it is quite possible that there is a lot of cached memory on the KVM Slave.
How to solve this error?
Moving ahead, let us see a method our Support Techs employ to fix this error.
The best solution here is to clear up the cached memory.
To do so,
- Firstly, we connect to the node via SSH
- Then we free up the cached memory:
# sync; echo 3 > /proc/sys/vm/drop_caches
Finally, suppose the solution does not help. Then we add RAM to the node.
[Need help with the fix? We are here for you]
Conclusion
To conclude, this error occurs while booting KVM VPS in SolusVM. Today, we saw how our Support Techs fix this error for our customers.
Very helpful, thanks! You also don’t need to reboot. Solus will auto boot once the cache is flushed.