Linux supports hot-adding memory when running as a VM guest, in VMware for example. (Sometimes you need to manually inform the guest OS.)

Is there a safe way to do the inverse operation — reducing the amount of memory allocated to a virtual machine, and if so, do you need to manually inform the Linux guest before such an operation? (If so, is the procedure specific to VMware tools, or is it generic for any kind of virtualization mechanism?)


ESXi doesn't support hot-removing memory or CPUs from a VM. Someone I met in the pub a couple of months ago told me that the sister of a friend of his cousin *cough* got the answer that virtually no customer demands this feature. In other words: It doesn't pay to bother implementing hot-remove.

If you want ESXi to support this, go to VMware and tell them. The more people do, the higher the chances they'll implement it.

  • 1
    Read this and had, "my best friend's sister's boyfriend's brother's girlfriend heard from this guy who knows this kid who's going with the girl who saw Ferris pass out at 31 Flavors last night. I guess it's pretty serious." – warren May 18 '15 at 21:39
  • It's interesting that a commercial company such as vmware is not supporting hot removal of memory, whilst KVM (free software) does. I'd say it's another great argument for free software. – aseq Jun 5 '15 at 22:15
  • @aseq While I'm a big fan of free software, I don't think that one single feature is a good reason for (or against) it. – Mario Lenz Jun 6 '15 at 19:24
  • It depends on the feature, however kvm has a lot of other things going for it. This particular one may just be the deciding factor. – aseq Jun 8 '15 at 18:23
  • @aseq Hot removal of memory might be the reason to choose KVM instead of ESXi, but that's a very specific decision and has nothing to do with the general advantages of free software.Let me put it like this: If it was the other way round (ESXi would support hot removal of memory and KVM wouldn't), would that be a great argument for proprietary software? I think not. – Mario Lenz Jun 9 '15 at 20:45

I can not say for sure in vmware, but when using kvm decreasing memory of a running virtual machine works fine. Of course up to a limit, but the software will tell you. When you decrease it the memory in the virtual machine will gradually be lowered, until it can't be lowered any further. If you set the memory to be lower than where it stopped you will need to reboot the virtual machine to have it lowered completely.

I recently did that on a system running kvm with about 20 virtual machines, where someone thought it wise to over commit memory, causing some virtual machines to run in swap (doh!). To fix it I lowered the memory by about 20-40% of 2/3 of the virtual machines and most were able to lower it completely while running. A few needed a reboot to have the new memory setting take effect completely.

Going from that I would assume a vmware virtual machine could allow this behaviour as well. However a quick test in vmware player tells me that it will need a reboot to take effect (fancier vmware software may behave nicer). Otherwise it is safe to do so on a running system. Of course whether the amount of memory it is left with is enough to run it correctly is another matter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.