Q: With a Linux virtual machine (VM) running on Hyper-V, why is the amount of memory available to Linux less than the amount I have configured for the VM?

A: It isn't actually less memory: The Linux kernel takes some of the memory, so it doesn't show that. If you run the command

top

or

cat /proc/meminfo

the memory total is displayed, but with some of the memory missing. For example, on a VM with 2048MB configured, I see the following:

MemTotal: 2069808 kB

This is less than the expected amount of kilobytes (2048 * 1024 is 2097152 kB). If, however, I use this command:

sudo dmidecode --type 17 | more

I see the full memory assigned to the VM, which the screen shot shows.

linuxvmmemory
Linux VM memory display

Get more help at John Savill's FAQs page.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish