Re: Lost memory, total memory size is not correct

From: Mike Fedyk
Date: Mon Jan 19 2004 - 17:24:31 EST


On Mon, Jan 19, 2004 at 06:58:05PM +0100, Paolo Ornati wrote:
> On Monday 19 January 2004 12:22, J?rgen Urban wrote:
> > 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.
>
> There are some addresses that cannot be used on PC because there is
> something mapped (for example System ROM...), you can see these regions
> doing "cat /proc/iomem".

That's usually just a few KB, but don't forget that MemTotal is what's left
after kernel memory is mapped.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/