is "shared memory" hardcoded to zero in gnome-system-monitor?
- From: Giovanni Gherdovich <g gherdovich gmail com>
- To: "gtk-devel-list gnome org" <gtk-devel-list gnome org>
- Subject: is "shared memory" hardcoded to zero in gnome-system-monitor?
- Date: Thu, 6 Mar 2014 01:54:36 +0100
Hello,
I was reading libgtop code and noticed this snippet at sysdeps/linux/mem.c
https://git.gnome.org/browse/libgtop/tree/sysdeps/linux/mem.c#n58
--------------8<-----------------------
file_to_buffer(server, buffer, sizeof buffer, FILENAME);
buf->total = get_scaled(buffer, "MemTotal:");
buf->free = get_scaled(buffer, "MemFree:");
buf->used = buf->total - buf->free;
buf->shared = 0;
buf->buffer = get_scaled(buffer, "Buffers:");
buf->cached = get_scaled(buffer, "Cached:");
--------------8<-----------------------
where FILENAME is /proc/meminfo.
Question:
why is buf->shared hardcoded to zero?
Is it intentional or a woops?
"man proc" is pretty vague about the "Shmem" field
of /proc/meminfo (it says "to be documented"),
which seems to be the candidate for filling buf->shared,
http://linux.die.net/man/5/procbut I was suprised to discover that gnome-system-monitor
is wired to a flat constant zero (is it?) when it comes to show
the amount of shared memory.
Cheers,
GGhh
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]