For some reason, an 11-STABLE amd64 system running under VirtualBox reports more physical memory than allocated by the host. For example, an allocation of 4096 MB physical memory by VirtualBox results in: FreeBSD 11.1-STABLE #0 r330790: Fri Mar 16 20:51:59 CET 2018 root@latitude.local:/usr/obj/amd64.amd64/usr/src/sys/GENERIC amd64 ... real memory = 4831838208 (4608 MB) avail memory = 4104138752 (3914 MB) sysctl also reports an odd value for hw.realmem: hw.physmem: 4260958208 hw.usermem: 4167311360 hw.realmem: 536870912 All figures are OK when running an i386 kernel in the same VM (but of course lower than in amd64 mode): FreeBSD 11.1-STABLE #0 r330790: Mon Mar 12 08:56:08 CET 2018 toor@latitude.local:/usr/obj/usr/src/sys/HMO i386 ... real memory = 3758030848 (3583 MB) avail memory = 3678859264 (3508 MB) hw.physmem: 3744882688 hw.usermem: 3710955520 hw.realmem: 3758030848 And also when reducing memory allocation from 4096 MB to 3072 MB the amd64 figures are sensible: FreeBSD 11.1-STABLE #0 r330790: Fri Mar 16 20:51:59 CET 2018 root@latitude.local:/usr/obj/amd64.amd64/usr/src/sys/GENERIC amd64 ... real memory = 3221159936 (3071 MB) avail memory = 3079446528 (2936 MB) hw.physmem: 3187220480 hw.usermem: 3106312192 hw.realmem: 3221159936
boot verbose: FreeBSD 11.1-STABLE #0 r330790: Fri Mar 16 20:51:59 CET 2018 root@latitude.local:/usr/obj/amd64.amd64/usr/src/sys/GENERIC amd64 ... real memory = 4831838208 (4608 MB) Physical memory chunk(s): 0x0000000000001000 - 0x000000000009bfff, 634880 bytes (155 pages) 0x0000000000100000 - 0x00000000001fffff, 1048576 bytes (256 pages) 0x00000000021fa000 - 0x00000000d8a43fff, 3599015936 bytes (878666 pages) 0x0000000100000000 - 0x000000011ffe7fff, 536772608 bytes (131048 pages) avail memory = 4104138752 (3914 MB) physical chunk view seems OK: (155+256+878666+131048)*4096 = 4137472000
Could you check smbios.memory.enabled ? Also, please check if dmidecode reports anything interesting about memory.
Created attachment 191573 [details] dmidecode output
(In reply to Andriy Gapon from comment #2) # kenv | fgrep smbios smbios.bios.reldate="12/01/2006" smbios.bios.vendor="innotek GmbH" smbios.bios.version="VirtualBox" smbios.chassis.maker="Oracle Corporation" smbios.planar.maker="Oracle Corporation" smbios.planar.product="VirtualBox" smbios.planar.serial="0" smbios.planar.version="1.2" smbios.system.family="Virtual Machine" smbios.system.maker="innotek GmbH" smbios.system.product="VirtualBox" smbios.system.serial="0" smbios.system.uuid="3414027f-54d3-4fa2-bdcb-6a3d2da28177" smbios.system.version="1.2" smbios.version="2.5" #
This issue still exists in 12-STABLE and latest VirtualBox version (5.2.22).
(In reply to Helge Oldach from comment #5) Still the same with FreeBSD 13.0-ALPHA2 #3 stable/13-c256213-g03d837b565a and virtualbox-ose-additions-5.2.44_3: 4096 MB memory allocated to the VM shows up as: real memory = 4831838208 (4608 MB) avail memory = 4137705472 (3946 MB) hw.physmem: 4278755328 hw.usermem: 4159344640 hw.realmem: 4831838208
Please, is this bug observable with non-BSD guests? 2008 retrospective: virtualbox.org • View topic - FreeBSD doesn't 'see' all available memory — <https://forums.virtualbox.org/viewtopic.php?f=4&t=6370> – led to this fix for BSD guests: <https://www.virtualbox.org/ticket/2342> ---- For reference, non-closed BSD guest bugs: <https://www.virtualbox.org/query?status=%21closed&guest=BSD>
I quickly fired up a fresh Ubuntu Server w/ 4GB which says: hmo@u:~$ grep MemTotal /proc/meminfo MemTotal: 4027028 kB hmo@u:~$ This is correct, so I assume it's a FreeBSD issue.