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 744890 - 16.0 EiB memory usage in the process list on FreeBSD
16.0 EiB memory usage in the process list on FreeBSD
Status: RESOLVED OBSOLETE
Product: libgtop
Classification: Core
Component: bsd
2.28.x
Other FreeBSD
: Normal normal
: ---
Assigned To: libgtop maintainers
libgtop maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-21 13:26 UTC by Ting-Wei Lan
Modified: 2018-01-22 18:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot of gnome-system-monitor on FreeBSD (117.20 KB, image/png)
2015-02-21 13:26 UTC, Ting-Wei Lan
  Details
Disable the mmap accounting (1.05 KB, patch)
2015-02-27 20:53 UTC, Benoît Dejean
none Details | Review
Disable the mmap accounting (2.46 KB, patch)
2015-02-28 04:21 UTC, Benoît Dejean
committed Details | Review

Description Ting-Wei Lan 2015-02-21 13:26:55 UTC
Created attachment 297495 [details]
Screenshot of gnome-system-monitor on FreeBSD

Please see the attached screenshot. Memory usage of some processes is 16 EiB.

It seems the odd value comes from function get_process_memory_info in src/proctable.cpp:

info->mem = info->memres - info->memshared;

If the value of resident memory is smaller than the value of shared memory, it will cause the memory usage becomes negative, which is incorrect.

The value of resident memory is directly provided by the kernel. It is the same as the RSS field of the output of ps command.

The value of shared memory is calculated from the virtual memory map. It scans the map, find entries with vnode object type, and return the sum of size of mapped files.


Is this a problem of gnome-system-monitor or libgtop?
Comment 1 Benoît Dejean 2015-02-21 13:42:30 UTC
I think its more an issue at the libgtop level. memshared should give the value of the shared memory, that is to say memory obtained by means like shm_open, etc. So it would be wrong to put in there the sum of all mapped files' sizes (which could be very large indeed) because a named mapped file does not mean that memory is allocated nor shared.
Comment 2 Benoît Dejean 2015-02-27 20:53:06 UTC
Created attachment 298135 [details] [review]
Disable the mmap accounting

I think it's best to just disable that 12 years old code for now.
I've compiled and tested it.
Comment 3 Benoît Dejean 2015-02-28 04:21:54 UTC
Created attachment 298148 [details] [review]
Disable the mmap accounting
Comment 4 Ting-Wei Lan 2015-02-28 07:42:19 UTC
Attachment 298148 [details] works fine on my system. linprocfs also always sets shared to 0 in statm although its comment says XXX.
Comment 5 Ting-Wei Lan 2015-04-01 15:44:05 UTC
Can we make this bug public? Are you going to push the patch or wait for a better solution?
Comment 6 Ting-Wei Lan 2015-05-02 09:34:58 UTC
I think it is better to push the change than to wait for a good solution, as the FreeBSD kernel doesn't provide an easy way to get the value of shared memory.
Comment 7 Benoît Dejean 2015-06-20 19:17:57 UTC
Patch is good, I've been using it for some time. (Bugzilla's broken, can't review it). Please commit.
Comment 8 Ting-Wei Lan 2015-06-21 03:01:05 UTC
I have pushed patches in attachment 298148 [details] [review] to master.
Comment 9 GNOME Infrastructure Team 2018-01-22 18:50:35 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/libgtop/issues/35.