Here is how it looks on my system.
firefox-bin─┬─GPU Process───35*[{GPU Process}] ├─Privileged Cont───27*[{Privileged Cont}] ├─RDD Process───5*[{RDD Process}] ├─Socket Process───5*[{Socket Process}] ├─Web Content───28*[{Web Content}] ├─2*[Web Content───27*[{Web Content}]] ├─Web Content───33*[{Web Content}] ├─Web Content───22*[{Web Content}] ├─Web Content───30*[{Web Content}] ├─Web Content───32*[{Web Content}] ├─WebExtensions───27*[{WebExtensions}] ├─firefox-bin └─97*[{firefox-bin}]
#!/bin/bash b=${1:-0}; d=''; s=0; S=(Bytes {K,M,G,T,P,E,Z,Y}iB) while ((b > 1024)); do d="$(printf ".%02d" $((b % 1024 * 100 / 1024)))" b=$((b / 1024)) let s++ done echo "$b$d ${S[$s]}"
echo 1024\*(pgrep foo| xargs pmap -x|grep total|awk '{print $5}'| paste -sd+ -)|bc|xargs human
function meminfo pgrep $argv| each pmap -x|g total|nth 5|sumof|multiplyby 1024|each human end
meminfo firefox returns only 250MB right now but meminfo 'firefox|Web' returns 1.5GB
If you are looking at just firefox you are definitely not getting the whole picture.
For context
pgrep --full /usr/lib/firefox/firefox | wc -l
pgrep 'firefox|Web' | wc -l
Your posted command formatted and a missing $ added (I'm using bash):
echo 1024\*\ $(\ pgrep --full /usr/lib/firefox/firefox \ | xargs pmap -x \ | grep total \ | awk '{print $5}'\ | paste -sd+ - \ )\ | bc \ | xargs ./human
Here's my htop excerpt:
3532M 286M 97512 S 0.0 9.6 9:20.59 │ └─ /usr/lib/firefox/firefox 2325M 74708 56596 S 0.0 2.4 0:00.42 │ ├─ /usr/lib/firefox/firefox -contentproc -childID 41 2509M 121M 85300 S 0.0 4.1 0:15.84 │ ├─ /usr/lib/firefox/firefox -contentproc -childID 40 2489M 173M 103M S 0.0 5.8 0:18.64 │ ├─ /usr/lib/firefox/firefox -contentproc -childID 39 2389M 74172 57060 S 0.0 2.4 0:13.49 │ ├─ /usr/lib/firefox/firefox -contentproc -childID 23 2540M 112M 89996 S 0.0 3.8 0:50.95 │ ├─ /usr/lib/firefox/firefox -contentproc -childID 22 2513M 72396 58300 S 0.0 2.4 0:14.88 │ ├─ /usr/lib/firefox/firefox -contentproc -childID 17 2413M 46488 34892 S 0.0 1.5 0:18.37 │ ├─ /usr/lib/firefox/firefox -contentproc -childID 16 250M 2132 1916 S 0.0 0.1 0:00.13 │ ├─ /usr/lib/firefox/firefox -contentproc -parentBuil 26.4G 85844 35008 S 0.0 2.8 0:57.39 │ └─ /usr/lib/firefox/firefox -contentproc -childID 3