DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 1st October 2011
raindog308 raindog308 is offline
Port Guard
 
Join Date: Sep 2011
Posts: 28
Thanked 0 Times in 0 Posts
Question 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.
Reply With Quote
  #2   (View Single Post)  
Old 1st October 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

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".
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:27 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick