Re: is "shared memory" hardcoded to zero in gnome-system-monitor?

It seems 0 is the correct value. See this bug:

And while the filenames have changed from 2.4, it seems the behavior is still the same:

On Wed, Mar 5, 2014 at 7:54 PM, Giovanni Gherdovich <g gherdovich gmail com> wrote:

I was reading libgtop code and noticed this snippet at sysdeps/linux/mem.c

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:");

where FILENAME is /proc/meminfo.

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,

but 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.


gtk-devel-list mailing list
gtk-devel-list gnome org


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]