1

I am setting up a lot of 64-bit RedHat VMs (VMware vSphere) for our development department in my company. Most of them start with 4096MB of RAM, but Linux only seems to recognize 3832MB. Can anyone tell me why that is?

8
  • Do you have some of the RAM committed to video by the BIOS? Unless you have a video card with its own memory, this is normal. – goldilocks Jul 30 '14 at 12:16
  • Can that be done from the VMware BIOS? – dhojgaard Jul 30 '14 at 12:19
  • VMWare, last time I used it, used the system memory pool for video memory. So I am willing to bet that you have 264 megs of video memory allocated to this VM. Should take this with a grain of salt, though, as I have not used VMWare in about 5 years. – user79155 Jul 30 '14 at 12:21
  • As far as i can see i do not have any memory allocated to video – dhojgaard Jul 30 '14 at 12:32
  • I missed the VM bit before, but it's even more likely in that case since emulation is involved. This may be just a difference in reporting between linux and the other OS in question (i.e., that video memory is used in both cases). What is it you see that leads to believe you "do not have any memory allocated to video"? – goldilocks Jul 30 '14 at 12:35
3

There are several reasons a piece of RAM would not be used by Linux:

  • If Linux detects it as belonging to a hardware peripheral. Most computers need RAM for the display, and thus reserve some RAM for the graphics card. It's also possible for the graphics card to contain its own RAM; as graphics cards have relatively high memory requirements, they tend not to get bundled with RAM of their own (but there are exceptions).
    At least VMware and VirtualBox count video memory as part of the memory allocated to a virtual machine. The size of the video memory is a setting in the VM configuration.
  • The range of memory addresses that Linux will use can be restricted with mem=… ad memmap=… parameters on the kernel command line.
  • Sometimes the kernel may be unable to use some of the memory. As RAM interfaces are pretty standard, this hardly ever happens except when you run a non-LPAE 32-bit kernel and have 4GB or more of RAM.
  • With ECC memory, some ranges where an error has been detected may be marked as unusable.

In practice, most of the time, the memory that Linux can use is the available RAM minus video memory (and possibly memory used by other hardware peripherals). Linux itself divides memory into two parts: the memory used by the kernel, and the memory that's available to processes. Most tools such as free report as the total figure the memory that's available to processes.

So if free shows a total of 3832MB and you have 4096MB of RAM on that (physical or virtual) machine, it means that

4096MB - 3832MB = video memory (+ other hardware memory) + kernel memory

264MB for hardware plus kernel sounds plausible. You have 3832MB available for applications because the rest is used by hardware and by the kernel.

0

In the vSphere client, hit "Edit Settings" on your virtual machine. Under the "Hardware" tab, select "Video card". You should see the video memory to the right. Mine default to 8MB.

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.