Re: 'free' and 'top' show the wrong amount of RAM


Subject: Re: 'free' and 'top' show the wrong amount of RAM
From: Jim Cole (greyleaf@yggdrasill.net)
Date: Thu Mar 02 2000 - 23:49:04 MST


OK. Hopefully some definitive information this time ;) Do a dmesg and
dig through the output. Somewhere not too far from the top, you will
see a line that looks something like....

Memory: 126660k available (1428k kernel code, 2840k data, 144k init)

If you add up all those numbers, you will get something that should
exactly equal the amount of physical RAM you have.

Down toward the bottom, you will see a another line that looks something
like...

Freeing unused kernel memory: 144k init 32k prep

If you add those numbers to the amount "available" in the first line,
you should get exactly the value you see in free and top.

I think what you mention below is just a coincidence. One of my PCs and my
Mac both have 128 MB physical, but the available memory differs significantly
between the two. I think all the differences are due to the gory details
in how the kernel was built, what all it actually does, which drivers it
is using, etc.

Jim

Robert Fout's bits of Thu, 2 Mar 2000 translated to:

>I just remembered something...another wrench into the works... running RHL
>6.1 on a PC with 64 MB of RAM, free showed ‰62 MB free (so the kernel
>[2.2.12-20] was using ‰2 MB of RAM)..running YDL 1.1 on my G3 with 128 MB of
>RAM, free shows ‰ 124 MB free, so the kernel [2.2.6] is using ‰4 MB of RAM...
>
>is it just coincidence that for every 64 MB of RAM the kernel uses 2 MB?
>
>Bob
>---------------------------------------
>"The knack to flying is learning how to
>throw yourself at the ground and miss."
>
>>>From "Life the Universe and Everything"
>by Douglas Adams
>
>Robert Fout
>MacOS Guru and MkLinux/Yellowdog Linux User
>rfout@damien.edu
>http://osx.damien.edu/rfout/
>ICQ# 48433406
>
>> From: Jim Cole <greyleaf@yggdrasill.net>
>> Reply-To: yellowdog-general@lists.yellowdoglinux.com
>> Date: Thu, 2 Mar 2000 22:20:45 -0700 (MST)
>> To: yellowdog-general@lists.yellowdoglinux.com
>> Subject: Re: 'free' and 'top' show the wrong amount of RAM
>>
>> Jason P. Stanford's bits of Fri, 3 Mar 2000 translated to:
>>
>>> Disk : 1,000 * 1024 bytes = 1,024,000 bytes =~ 1MB
>>> Memory : 2^20 bytes = 1,048,576 bytes =~ 1MB RAM
>>>
>>> One megabyte of disk storage is comprised of 1,000 units of 1,024 bytes,
>>> whereas one megabyte of memory (RAM) is comprised of 2^20 bytes.
>>
>> I would have to disagree. 1000 units of 1024 bytes is just 1000 1KB blocks,
>> not 1 MB. A MB is always 1024^2 bytes. If you check the man pages for du
>> and df, they at least agree with me ;) Both equate the -m (--megabytes)
>> option with --blocksize=1048576.
>>
>> I am 99.9% certain that *missing memory* issue that started all of this
>> is due to the fact that free and top on a monolithic Linux kernel report
>> the remaining memory available for daemons, user programs, etc. after
>> the kernel has been loaded up.
>>
>>
>> Jim
>>
>
>



This archive was generated by hypermail 2a24 : Sun Apr 02 2000 - 21:09:29 MDT