/proc/meminfo values
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
Quoted 3 lines · Andreas Unterkircher
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.
Signature · 3 lines
"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
Quoted 4 lines · Andreas Unterkircher
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.
Quoted 7 lines
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
Am Mon, den 22.12.2003 schrieb Rob Love um 16:31:
Quoted 14 lines · Andreas Unterkircher
Quoted 5 lines
cat
/proc/meminfo
total: used: free: shared: buffers: cached:Mem: 244191232 238395392 5795840 0 2732032 138403840 Swap: 509923328 147443712 362479616This view is gone. Use something like free(1) or a custom script to recreate it.
Quoted 4 lines
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?
Quoted 6 lines
Quoted 3 lines
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
Quoted 4 lines
Rob Love
Quoted 4 lines · Andreas Unterkircher
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