Missing Memory

Discussions about using non Windows and Linux guests such as FreeBSD, DOS, OS/2, OpenBSD, etc.
Post Reply
N0YB
Posts: 36
Joined: 20. Sep 2012, 18:55

Missing Memory

Post by N0YB »

VM
Type: BSD
Version: FreeBSD (64-bit) (also 32-bit)
Base Memory: 512 MB

FreeBSD (11.0 and 10.3, probably others too) reports "real memory = 536805376 (511 MB)" when booting.
536805376 / 1024^2 = 511.9375 MB
1024^2 * 512 - 536805376 = 65536 (64 KB)

So where is the missing 64 KB real memory?

You might think 64 KB missing memory is no big deal. And from just a quantitative perspective it's not. But some processes alter their behavior based on amount of real memory the system has, such as not starting opcache if < 512 MB real memory. Then it matters. Sure the threshold could be changed/lowered but why should it need to be.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Missing Memory

Post by mpack »

Why are you asking here about how BSD reports memory? I would have thought a BSD forum more appropriate.
N0YB
Posts: 36
Joined: 20. Sep 2012, 18:55

Re: Missing Memory

Post by N0YB »

Are you saying that BSD incorrectly reports the amount of real memory? I have no reason to think that is the case, as BSD reports the correct amount of memory in a physical machine. So it is reasonable to first be sure VirtualBox is actually providing the entire amount of memory the client is configured for. And doing so properly, i.e. not withholding 64KB for virtual BIOS or something.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Missing Memory

Post by mpack »

I'm saying that a PC does not modify its behaviour depending on which OS you install, so it doesn't make sense to look at the PC when one particular type of of installed OS reports something that other OS's do not.

A VM is just a PC.
N0YB
Posts: 36
Joined: 20. Sep 2012, 18:55

Re: Missing Memory

Post by N0YB »

A VM is a PC that is modified depending on the OS it is configured for. In this case BSD.

This is not OS specific. As was mentioned in the opening post. "probably others too". Same missing 64 KB real/physical memory in CentOS 7 Linux too. The common thread is VirtualBox.

Type: Linux
Version: Red Hat (64-bit)
Base Memory: 768 MB

CentOS Linux (7.3.1611, probably others too) reports "Memory: 737380k/786368k available" when booting.

786368k = 805240832 (786368 * 1024)
805240832 / 1024^2 = 767.9375 MB
1024^2 * 768 - 805240832 = 65536 (64 KB)

So, again, where is the missing 64 KB real/physical memory?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Missing Memory

Post by mpack »

N0YB wrote:A VM is a PC that is modified depending on the OS it is configured for. In this case BSD.
The only thing different about each VM is what type of NIC etc it gets by default. And RAM is RAM.

I assume that, like most other OS's, some RAM will be consumed by the bootstrap, BIOS and to map hardware. As I said before, if you particularly want to know what RAM gets swallowed by a BSD boot, best ask on a BSD site.
N0YB
Posts: 36
Joined: 20. Sep 2012, 18:55

Re: Missing Memory

Post by N0YB »

And like I said. It is not BSD specific. BDS, and others, do not come up 64 KB short on physical hardware. Only on VirtualBox. The OS's should not tell the difference between physical and virtual machine. If they do then the virtual machine is poorly / incorrectly implemented. As I mentioned before, still have no reason to think this is an issue with multiple OS's. The evidence points to VirtualBox.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Missing Memory

Post by mpack »

Have it your way. If you want an answer to your question then I suspect you'll have to download the source code - for both VirtualBox and BSD.
N0YB
Posts: 36
Joined: 20. Sep 2012, 18:55

Re: Missing Memory

Post by N0YB »

It's not about having it my way. Following the evidence just makes sense. If I were to go to a BSD forum and ask they would just say talk to VirtualBox about their VM memory allocation. And rightfully so, since BSD and others detect correctly on physical hardware. You have provided no evidence that this is an OS issue and not a VirtualBox issue. I've shown evidence by way of multiple OS's. Show me some evidence that it is OS's and not VirtualBox. Don't just baselessly finger point.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Missing Memory

Post by Perryg »

I am not sure why this is true but there is a difference of 45K available to the guest. I honestly never thought about it until now so I decided to test it. Linux host has 32GB and accurately reads with "free". Assigned 16GB to a Linux server and ran "free" then doubled the reading and it shows a missing 45K. Who knew. I have not looked at the source code in this area so you would need to ask the DEVs on IRC or their mailing list to get a real answer. The chance I will have time to search the code any time soon is minimal.

Note: "free" actually sees what the OS says is actually installed in the guest just like on metal.
N0YB
Posts: 36
Joined: 20. Sep 2012, 18:55

Re: Missing Memory

Post by N0YB »

VirtualBox missing 64 KB.
Bare Metal not missing any. Reports exactly what is installed.

VirtualBox, CentOS Linux 7.3 (64-bit), 768 MB, Missing 65536 (64 KB)
bootup reported memory (dmesg log): Memory: 737380k/786368k available

VirtualBox, FreeBSD 10.3 (32-bit), 512 MB, Missing 65536 (64 KB)
bootup reported memory (dmesg log): real memory = 536805376 (511 MB), avail memory = 489668608 (466 MB)

VirtualBox, FreeBSD 11.1 (64-bit), 512 MB, Missing 65536 (64 KB)
bootup reported memory (dmesg log): real memory = 536805376 (511 MB), avail memory = 462753792 (441 MB)

Bare Metal, FreeBSD 10.3 (32-bit), 512 MB, Missing 0 (0 KB)
bootup reported memory (dmesg log): real memory = 536870912 (512 MB), avail memory = 489521152 (466 MB)

Bare Metal, FreeBSD 10.3 (32-bit), 2048 MB, Missing 0 (0 KB)
bootup reported memory (dmesg log): real memory = 2147483648 (2048 MB), avail memory = 2072317952 (1976 MB)
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Any and all
Contact:

Re: Missing Memory

Post by michaln »

It's not "bare metal". There are differences between systems in how exactly they manage memory. The exact amount of memory available to an OS depends on both hardware (chipset) and firmware. So unless you specify what system and what firmware version exactly was used, the number is completely meaningless.

You're welcome to go through VirtualBox and figure out where the "missing" 64K is hiding. But don't expect anyone else to do the work for you, it's not worth it.
Post Reply