|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
Hey, where'd my RAM go?
Booting OpenBSD 4.9 but this question probably applies to all BSDs.
My laptop has 2GB of memory. The BIOS does say 2048M. I'm booting the amd64 kernel. dmesg at boot-time says: real mem = 2035MB avail mem = 1967MB The kernel is about 9MB. So: 2048MB - 9MB = 2039MB. Where did the other 4MB go? And is the difference between 2035MB and 1967MB various kernel memory structures (i.e., its working space)? I guess I'm not really sure what "real mem" is supposed to represent (I thought it was physical - size of kernel). I assume "avail mem" is the memory available to all processes. Just curious. |
|
|||
The boot(8) program gets a memory map from the BIOS, the BIOS is both mapped into address space and copied to RAM, and the BIOS itself reserves memory for structures that get used by the OS, for ACPI/SMBIOS and various other things.
So, "real mem" is what is calculated from all the free ranges passed to the kernel in the memory map.. on 32-bit systems and 64-bit with buggy chipsets, RAM that can't be mapped into 4G of address space is simply unconnected or lost. There is more than just RAM in physical address space such as memory mapped devices, ROM, and special reverse areas for legacy reasons. The kernel allocates memory for the size of the kernel image along with various structures, buffers/caches, stack space... some is dynamically allocated, and some is static. It's really not as simple as "used" or "free" on paged virtual memory systems, there are several different "pools". |
|
|