GNOME Bugzilla – Bug 744890
16.0 EiB memory usage in the process list on FreeBSD
Last modified: 2018-01-22 18:50:35 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?
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.
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.
Created attachment 298148 [details] [review] Disable the mmap accounting
Attachment 298148 [details] works fine on my system. linprocfs also always sets shared to 0 in statm although its comment says XXX.
Can we make this bug public? Are you going to push the patch or wait for a better solution?
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.
Patch is good, I've been using it for some time. (Bugzilla's broken, can't review it). Please commit.
I have pushed patches in attachment 298148 [details] [review] to master.
-- 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.