tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: where is my memory?

Doh! And I wasn't thinking straight. In the VAX (atleast) the printouts of the two values are actually avail_end (which is physical memory after some small stuff have been reserved away), and, which is (probably) a fairly different number. I guess more stuff have been allocated away permanently, before the printout happens.

But in general, the difference of the two numbers is that available memory is more or less what is left once more or less permanent allocations done by the kernel have been done.


Johnny Billquist wrote:
der Mouse wrote:
total memory = 2047 MB
avail memory = 1999 MB
total memory = 256 MB
avail memory = 239 MB
Some graphics chips, especially on lower-end machines, use main
memory, thus making it unavailable to the CPU.

It's not that simple.  I've seen this for a very long time, including
on machines with no graphics chips at all, such as 4.3 on a VAX 750.
Here's a live example; this is quoted from /var/run/dmesg.boot on a
SPARCstation LX that's my desktop at one of my workplaces:

total memory = 48688 KB
avail memory = 41676 KB

That's with a cg6 with its own private framebuffer RAM.

Well, for VAXen, the difference between total memory, and available
memory is:


        format_bytes(pbuf, sizeof(pbuf), avail_end);
        printf("total memory = %s\n", pbuf);
        panicstr = NULL;
        mtpr(AST_NO, PR_ASTLVL);

#if VAX46 || VAX48 || VAX49 || VAX53 || VAXANY
        minaddr = 0;

         * Allocate a submap for physio.  This map effectively limits the
         * number of processes doing physio at any one time.
        phys_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
                                   VM_PHYS_SIZE, 0, false, NULL);

        format_bytes(pbuf, sizeof(pbuf), ptoa(;
        printf("avail memory = %s\n", pbuf);


So, obviously a malloc for physio... :-)

Don't know about any other ports, but the code is there for the


Home | Main Index | Thread Index | Old Index