Real and availible RAM

Terry Lambert tlambert2 at
Mon May 5 20:19:47 PDT 2003

agent dero wrote:
> I have been looking through the kernel boot messages in /var/log while
> working on some custom kernel compile work, and I came across something
> that I think is very interesting, but doesn't make sense.
> real memory  = 100663296 (98304K bytes)
> avail memory = 94580736 (92364K bytes)
> This tells me that FreeBSD recognizes my 98MB of RAM, but it only uses 92MB?

No.  It means that FreeBSD used 6MB of RAM to load itself
through locore.s mp_machdep.c, and init_main.c before it got
to the point where it enabled the virtual memory system to
the point it could account it for you.

Also note that "real memory" is not the same as "physical
memory" (I frequently add a third line called "phys memory ="
to my status display, when I start caring about where RAM
is going to enough that I worry about 6M here or there).

> Are the 6MB of RAM that are left getting shafted, and just using power,
> but not being addressed by FreeBSD?

No.  You need to read and understand the code that reports
these two values, and why it reports a discrepancy.

> Does this slow down my machine at all,
> I mean, is there a percentage to this? Where only x% of 100% RAM is
> availible or usable?

Yes and no.  You can't reuse any memory used for page tables,
so that's "pure overhead".  You also can't reuse any memory
that has not been marked as swappable.  If you allocate memory
in the kernel, it will be permanently subtracted from the "avail"
(it just doesn't give you another message to the effect of any
chanes in "avail", because it would be printf'ing to the console
all the time, if it did), since kernel memory is allocated as
being type-stable.

> Also, I use phpSysInfo to judge the status of most of my remote servers,
> and it shows the caches and buffers as part of the whole chunk of used
> RAM, so at one point it can be up to 95% of the RAM. But then 10 minutes
> later it will have dropped back down to 50% or so, showing that the
> buffers were somehow cleared? Is there anyway to do this manually?

1)	Use "sync", and wait

2)	Kill processes

-- Terry

More information about the freebsd-performance mailing list