After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 104747 - Missing memory information
Missing memory information
Status: RESOLVED FIXED
Product: libgtop
Classification: Core
Component: linux
2.0.x
Other Linux
: Normal normal
: ---
Assigned To: Martin Baulig
Martin Baulig
: 104818 117815 122445 123522 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-01-29 19:13 UTC by Anders Rune Jensen
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to support kernel 2.5 (2.26 KB, patch)
2003-03-27 17:13 UTC, adam
none Details | Review
A patch to fix memory usage with 2.6 kernel (2.85 KB, text/plain)
2003-10-18 23:38 UTC, Sebastien Bacher
  Details
A fix with no difference between 2.4 and 2.6 kernels (2.33 KB, patch)
2003-10-20 17:34 UTC, Sebastien Bacher
none Details | Review

Description Anders Rune Jensen 2003-01-29 19:13:21 UTC
It seems libgtop can't properly parse meninfo when running kernel 2.5.
/proc/meninfo has changed because of the new VM.
Comment 1 adam 2003-03-27 17:13:14 UTC
Created attachment 15235 [details] [review]
Patch to support kernel 2.5
Comment 2 Kjartan Maraas 2003-06-10 17:24:25 UTC
*** Bug 104818 has been marked as a duplicate of this bug. ***
Comment 3 Philippe Gauthier 2003-07-29 19:26:33 UTC
From reading the kernel development mailing list, it seems to be
expected from user utilities that they parse the /proc/meminfo field
headers instead of relying on the order of the lines of data.

Doing so would allow the kernel developers to play a bit with the
output of /proc/meminfo (and this is what they need, I guess) without
having to worry about breaking user utilities and libgtop. Also, it is
my personal opinion that relying on a fixed format is always some kind
of a gamble.

I would personally like to have comments on this, and I would be ready
to try to propose a concurrent patch if necessary.
Comment 4 Kevin Vandersloot 2003-10-12 13:42:04 UTC
*** Bug 122445 has been marked as a duplicate of this bug. ***
Comment 5 Kevin Vandersloot 2003-10-12 13:42:33 UTC
*** Bug 117815 has been marked as a duplicate of this bug. ***
Comment 6 Kevin Vandersloot 2003-10-12 13:45:02 UTC
Here's the output of /proc/meminfo from one of the duplicate bugs.

Linux 2.6.0-test4 on Debian SID:

cat /proc/meminfo

MemTotal:       515772 kB
MemFree:        130120 kB
Buffers:         35172 kB
Cached:         161680 kB
SwapCached:          0 kB
Active:         237840 kB
Inactive:       120708 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:       515772 kB
LowFree:        130120 kB
SwapTotal:     1132500 kB
SwapFree:      1132500 kB
Dirty:             140 kB
Writeback:           0 kB
Mapped:         227928 kB
Slab:            18572 kB
Committed_AS:   299116 kB
PageTables:       1780 kB
VmallocTotal:   516024 kB
VmallocUsed:     20616 kB
VmallocChunk:   493712 kB
HugePages_Total:     0
HugePages_Free:      0
Hugepagesize:     4096 kB


Below is the first three lines from the output generated by
cat /proc/meminfo on Linux 2.4.20, these are absent in 2.5/2.6

        total:    used:    free:  shared: buffers:  cached:
Mem:  30162944 28852224  1310720        0  4988928  7163904
Swap: 386576384  2654208 383922176
Comment 7 Kevin Vandersloot 2003-10-12 13:51:05 UTC
Philippe: that sounds like a great idea. Are you still interested in
working on a patch?


The patch already attached doesn't seem correct to me in that it only
checks for version = 2.5 or everythis else is considered 2.4 and lower
format. What if the version is 2.6 or greater?
Comment 8 Philippe Gauthier 2003-10-12 14:18:53 UTC
Ok, I will try to do something for this patch.  Anyway, most of the
monitor applications didn't break on my kernel 2.6 test machine so I
guess it's just a case of building a more flexible parser. Also, I
hope that 2.6.0-test6 is near from stable enough to be reliable.
Comment 9 Luke Maurer 2003-10-12 23:35:00 UTC
Incidentally, in my experience, overall stability in the 2.6-test
series has been very good; it's no mystery why more people are making
the jump.
Comment 10 Sebastien Bacher 2003-10-18 23:38:37 UTC
Created attachment 20785 [details]
A patch to fix memory usage with 2.6 kernel
Comment 11 Vincent Untz 2003-10-20 15:57:16 UTC
*** Bug 123522 has been marked as a duplicate of this bug. ***
Comment 12 Kevin Vandersloot 2003-10-20 16:09:16 UTC
seb128@debian.org: It seems that your patch is almost correct. It
seems to me though that we should be able to read the 2.4 mem file
just like the 2.5 and greater. 

Can't I just do
  buf->total = get_scaled(buffer, "SwapTotal:");
  buf->free = get_scaled(buffer, "SwapFree:");
for any of the versions? 2.4 /proc/meminfo contains every line in the
2.6 version plus the first two lines in addition. Thus your solution
for reading 2.6 /proc/meminfo should work with the 2.4 version.
Comment 13 Sebastien Bacher 2003-10-20 17:34:23 UTC
Created attachment 20824 [details] [review]
A fix with no difference between 2.4 and 2.6 kernels
Comment 14 Bastien Nocera 2003-10-20 20:41:36 UTC
Patch committed to gnome-2-4 and HEAD.

Thanks