Re: calculating process memory usage

2020-08-15 Thread Florian Weimer
* Samuel Sieb:

> Since you've brought this up, this is a question I've had for a long 
> time.  How do you get real memory+swap usage information for processes 
> or is that even possible?  Looking in ps or top, the RES is way too 
> small and the VIRT/VSIZE is way too big.  ps_mem is also way too small, 
> or at least the total is less than half of the real memory usage.  Is 
> there something else using that much memory that isn't processes? 
> buffers and cache don't account for the difference either.

There's a tool called smem which is supposed to attribute shared
mappings in a more reasonable way.  People use it with ZGC (pne of the
OpenJDK garbage collectors) because it maps the heap multiple times,
grossly inflating traditional RSS values.
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: calculating process memory usage

2020-08-14 Thread Samuel Sieb

On 8/14/20 4:34 PM, Samuel Sieb wrote:

On 8/14/20 1:52 PM, Chris Murphy wrote:

/proc/pid/status

VmHWM or  VmRSS + VmSwap


Yes, thank you!
VmHWM is not so useful for this case, but certainly for others.
Comparing with the "top" numbers, the VmRSS total looks slightly high, 
depending on how zswap factors in to the numbers.

The VmSwap total is short by about 2GB (out of 12GB).
But that's the information I was looking for.  Now I can do some 
analysis to figure out what's hogging my (virtual) memory.


And it gave a very unexpected result.  The top two offenders are:
/usr/libexec/gnome-shell-calendar-server 3167256  (3GB)
/usr/libexec/evolution-calendar-factory 2006908   (2GB)

They have almost no RSS.

For anyone curious, this is how I did it:
grep VmSwap /proc/*/status | sort -r -n -k 2 | while read name size kb; 
do echo "$(readlink /proc/$(echo ${name} | cut -d/ -f 3)/exe) $size"; 
done | less


That's all one line.
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: calculating process memory usage

2020-08-14 Thread Samuel Sieb

On 8/14/20 1:52 PM, Chris Murphy wrote:

/proc/pid/status

VmHWM or  VmRSS + VmSwap


Yes, thank you!
VmHWM is not so useful for this case, but certainly for others.
Comparing with the "top" numbers, the VmRSS total looks slightly high, 
depending on how zswap factors in to the numbers.

The VmSwap total is short by about 2GB (out of 12GB).
But that's the information I was looking for.  Now I can do some 
analysis to figure out what's hogging my (virtual) memory.

___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: calculating process memory usage

2020-08-14 Thread Chris Murphy
On Fri, Aug 14, 2020 at 2:29 PM Samuel Sieb  wrote:
>
> On 8/14/20 11:41 AM, Sergio Belkin wrote:
> > Perhaps this ps_mem snippet is useful:
> >  > Private  +   Shared  =  RAM used   Program
> > 
> > 
> > 
> > 294.8 MiB +   4.7 MiB = 299.4 MiB   telegram-desktop.bin
> > 290.3 MiB +  22.1 MiB = 312.4 MiB   rocketchat-desktop (5)
> > 323.8 MiB +   9.5 MiB = 333.2 MiB   kwin_x11 (9)
> > 344.5 MiB +   1.4 MiB = 345.8 MiB   nextcloud
> > 373.2 MiB +  21.2 MiB = 394.4 MiB   spotify (5)
> > 416.6 MiB +   1.3 MiB = 417.9 MiB   plasma-discover
> > 448.5 MiB +  16.6 MiB = 465.2 MiB   MainThread
> > 892.8 MiB + 444.5 KiB = 893.2 MiB   packagekitd
> >1.0 GiB +   8.6 MiB =   1.0 GiB   plasmashell
> >1.9 GiB +  81.0 MiB =   1.9 GiB   Web Content (9)
> > -
> >9.7 GiB
> > =
>
> Since you've brought this up, this is a question I've had for a long
> time.  How do you get real memory+swap usage information for processes
> or is that even possible?  Looking in ps or top, the RES is way too
> small and the VIRT/VSIZE is way too big.  ps_mem is also way too small,
> or at least the total is less than half of the real memory usage.  Is
> there something else using that much memory that isn't processes?
> buffers and cache don't account for the difference either.


Maybe ...

/proc/pid/status

VmHWM or  VmRSS + VmSwap


-- 
Chris Murphy
___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


Re: calculating process memory usage

2020-08-14 Thread Samuel Sieb

On 8/14/20 11:41 AM, Sergio Belkin wrote:

Perhaps this ps_mem snippet is useful:



294.8 MiB +   4.7 MiB = 299.4 MiB       telegram-desktop.bin
290.3 MiB +  22.1 MiB = 312.4 MiB       rocketchat-desktop (5)
323.8 MiB +   9.5 MiB = 333.2 MiB       kwin_x11 (9)
344.5 MiB +   1.4 MiB = 345.8 MiB       nextcloud
373.2 MiB +  21.2 MiB = 394.4 MiB       spotify (5)
416.6 MiB +   1.3 MiB = 417.9 MiB       plasma-discover
448.5 MiB +  16.6 MiB = 465.2 MiB       MainThread
892.8 MiB + 444.5 KiB = 893.2 MiB       packagekitd
   1.0 GiB +   8.6 MiB =   1.0 GiB       plasmashell
   1.9 GiB +  81.0 MiB =   1.9 GiB       Web Content (9)
-
                           9.7 GiB
=


Since you've brought this up, this is a question I've had for a long 
time.  How do you get real memory+swap usage information for processes 
or is that even possible?  Looking in ps or top, the RES is way too 
small and the VIRT/VSIZE is way too big.  ps_mem is also way too small, 
or at least the total is less than half of the real memory usage.  Is 
there something else using that much memory that isn't processes? 
buffers and cache don't account for the difference either.

___
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org