public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jürgen Urban" <jur@sysgo.com>
To: <linux-kernel@vger.kernel.org>
Subject: Lost memory, total memory size is not correct
Date: Mon, 19 Jan 2004 12:22:23 +0100	[thread overview]
Message-ID: <200401191222.23449.jur@sysgo.com> (raw)

Hello,

I tried to get the amount of total physical memory. I looked at /proc/meminfo 
and found this line (2.4.18):

MemTotal:        30844 kB

But this is not correct the system have 32768 kB Memory. I looked at kernel 
sources and I found the variable max_mapnr. Can I use it to detect the 
correct memory size? It seems that it stores the maximum number of pages 
usable. So I can convert it with macro K() in linux/fs/proc/proc_misc.c to a 
value in kB.

But there are 1924 kB not available (32768 kB - 30844 kB). On system boot I 
get the following message:
Memory: 30780k available (960k kernel code, 392k data, 64k init, 0k highmem)
So I calculated:

1924 kB
-960 kB Kernel
- 392 kB Data
- 64 kB Init
--------------------
508 kB

There are 508 kB lost (?) memory. It seems the boot allocator is reserving 
this memory, but linux doesn't tell for what. I want to know for what the 508 
kB are. Is the kernel stack included in the 508 kB or in the 30844 kB. I 
don't think so, because the value 30844 kB isn't changing after boot. And 
every process should allocate 8 kB kernel stack.

Best Regards
Jürgen Urban

-- 
Jürgen Urban <jur@sysgo.com>
Software Engineer

SYSGO Real-Time Solutions AG
Am Pfaffenstein 14
55270 Klein-Winternheim, Germany

Telefon: +49-6136-9948-0
FAX: +49-6136-9948-10
www.sysgo.com


             reply	other threads:[~2004-01-19 11:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-19 11:22 Jürgen Urban [this message]
2004-01-19 17:58 ` Lost memory, total memory size is not correct Paolo Ornati
2004-01-19 22:22   ` Mike Fedyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200401191222.23449.jur@sysgo.com \
    --to=jur@sysgo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox