* /proc/meminfo values
@ 2003-12-22 14:50 Andreas Unterkircher
2003-12-22 15:18 ` Rik van Riel
2003-12-22 15:31 ` Rob Love
0 siblings, 2 replies; 5+ messages in thread
From: Andreas Unterkircher @ 2003-12-22 14:50 UTC (permalink / raw)
To: linux-kernel
hello.
one question, didn't find any other information souce.
in kernel 2.4 /proc/meminfo writes back exactly mem info values
in the first 2 lines like:
cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 244191232 238395392 5795840 0 2732032 138403840
Swap: 509923328 147443712 362479616
but with 2.6 it looks like they have been removed. where can i get the
exactly free memory (+ swap) from the kernel so i havn't to use the
kb-values which i get back from /proc/meminfo?
i try to check the source good from "free" (with the -b option it
returns the bytes-value) which seems to simple multiply *1024 to
the kb values.
thanks for any info!
greetings, andi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: /proc/meminfo values
2003-12-22 14:50 /proc/meminfo values Andreas Unterkircher
@ 2003-12-22 15:18 ` Rik van Riel
2003-12-22 15:31 ` Rob Love
1 sibling, 0 replies; 5+ messages in thread
From: Rik van Riel @ 2003-12-22 15:18 UTC (permalink / raw)
To: Andreas Unterkircher; +Cc: linux-kernel
On Mon, 22 Dec 2003, Andreas Unterkircher wrote:
> but with 2.6 it looks like they have been removed. where can i get the
> exactly free memory (+ swap) from the kernel so i havn't to use the
> kb-values which i get back from /proc/meminfo?
The values are in page granularity. On x86 you're not going
to get them at any finer granularity than 4kB increments,
because that is the page size.
The kB values are still smaller than the allocation granularity,
so no accuracy is lost.
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: /proc/meminfo values
2003-12-22 14:50 /proc/meminfo values Andreas Unterkircher
2003-12-22 15:18 ` Rik van Riel
@ 2003-12-22 15:31 ` Rob Love
2003-12-22 15:34 ` Andreas Unterkircher
1 sibling, 1 reply; 5+ messages in thread
From: Rob Love @ 2003-12-22 15:31 UTC (permalink / raw)
To: unki; +Cc: linux-kernel
On Mon, 2003-12-22 at 09:50, Andreas Unterkircher wrote:
> cat /proc/meminfo
> total: used: free: shared: buffers: cached:
> Mem: 244191232 238395392 5795840 0 2732032 138403840
> Swap: 509923328 147443712 362479616
This view is gone. Use something like free(1) or a custom script to
recreate it.
> but with 2.6 it looks like they have been removed. where can i get the
> exactly free memory (+ swap) from the kernel so i havn't to use the
> kb-values which i get back from /proc/meminfo?
>
> i try to check the source good from "free" (with the -b option it
> returns the bytes-value) which seems to simple multiply *1024 to
> the kb values.
But everything is page granularity already, which is 4KB on x86. Going
to bytes would not gain you anything.
Rob Love
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: /proc/meminfo values
2003-12-22 15:31 ` Rob Love
@ 2003-12-22 15:34 ` Andreas Unterkircher
2003-12-22 18:40 ` Mike Fedyk
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Unterkircher @ 2003-12-22 15:34 UTC (permalink / raw)
To: Rob Love; +Cc: linux-kernel
Am Mon, den 22.12.2003 schrieb Rob Love um 16:31:
> On Mon, 2003-12-22 at 09:50, Andreas Unterkircher wrote:
>
> > cat /proc/meminfo
> > total: used: free: shared: buffers: cached:
> > Mem: 244191232 238395392 5795840 0 2732032 138403840
> > Swap: 509923328 147443712 362479616
>
> This view is gone. Use something like free(1) or a custom script to
> recreate it.
>
> > but with 2.6 it looks like they have been removed. where can i get the
> > exactly free memory (+ swap) from the kernel so i havn't to use the
> > kb-values which i get back from /proc/meminfo?
> >
> > i try to check the source good from "free" (with the -b option it
> > returns the bytes-value) which seems to simple multiply *1024 to
> > the kb values.
>
> But everything is page granularity already, which is 4KB on x86. Going
> to bytes would not gain you anything.
Ok, i'm unterstand :) I will simple multiply the proc values with 1024
when i want to use them with the cricket-snmp-collector. this seems to
be exactly enough - i only want to know - thanks rob and rik for the
info!
greetings, andi
>
> Rob Love
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: /proc/meminfo values
2003-12-22 15:34 ` Andreas Unterkircher
@ 2003-12-22 18:40 ` Mike Fedyk
0 siblings, 0 replies; 5+ messages in thread
From: Mike Fedyk @ 2003-12-22 18:40 UTC (permalink / raw)
To: Andreas Unterkircher; +Cc: Rob Love, linux-kernel
On Mon, Dec 22, 2003 at 04:34:38PM +0100, Andreas Unterkircher wrote:
> Ok, i'm unterstand :) I will simple multiply the proc values with 1024
> when i want to use them with the cricket-snmp-collector. this seems to
> be exactly enough - i only want to know - thanks rob and rik for the
> info!
You might want to check out the perl script I updated recently in the lrrd
project. It tries to extract as much information from each kernel version
as possible that is presented in /proc/meminfo (and slabinfo for 2.4).
http://cvs.sourceforge.net/viewcvs.py/lrrd/lrrd/client/lrrd.d.linux/memory.in?sortby=date
Mike
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-12-22 18:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-22 14:50 /proc/meminfo values Andreas Unterkircher
2003-12-22 15:18 ` Rik van Riel
2003-12-22 15:31 ` Rob Love
2003-12-22 15:34 ` Andreas Unterkircher
2003-12-22 18:40 ` Mike Fedyk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox