Try typing “about:memory” into the address bar and hit measure.  You will see where it is all going.

On Wed, Jul 7, 2021 at 11:48 PM Tomasz Rola <rtomek@ceti.pl> wrote:
On Wed, Jul 07, 2021 at 08:50:51PM +0000, Michael Kjörling wrote:
> On 7 Jul 2021 20:32 +0200, from rtomek@ceti.pl (Tomasz Rola):
> > An excerpt from my ps:
> >
> > USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
> >
> > xxxon    12331 12.5 20.4 5898360 2519640 ?     TNsl Mar29 18278:11 firefox-esr
>
> I'm going to stick my neck out here by saying that the VSZ and RSS
> values reported by ps, at least for Firefox, are largely meaningless.
>
> I started my usual Firefox instance, which has a handful of plugins,
> about a metric gazillion bookmarks, and has been my main web browser
> profile for years (so it probably has collected some crud over time).
> `ps auxw` reported that process as having a total RSS of a whopping
> 374 GB.
>
> It is downright _impossible_ that Firefox could actually be using that

This is quite strange for me. Without looking at your system I can only
suspect it has something to do with multithreading.

If I do two different commands as root, with firefox pid here
.eq. 12331, as above:

=>  (500 15):    lsof -p 12331 | wc -l
402

=>  (500 17):   lsof | awk '$2==12331' | wc -l
22055

The first column gives a name, and in second case it not always is
'firefox'. I am yet to study manpage for lsof and play with it, but it
surely shows interesting things.

On my system, when firefox gets killed, 'free' shows a difference - if
I recall, free mem increases by the size of rss plus all the stuff
which was opened and released from buffers. I did not pay much
attention, I assumed numbers would match and this is what they
probably did :-).

OS on my box used to report to me as Debian, and still does, but some
years ago I have decided to skip the usual system upgrade, and after
some more time I started to upgrade various elements by hand. So it is
more like a tattered patchwork right now. But it does what I expect,
hopefully.

[...]
> That's a _factor almost 2300x_ difference between the reported RSS,
> and the amount of memory that was actually freed up by closing the
> browser.

Yeah, strange.

[...]
> On modern systems, with everything from shared libraries to
> memory-mapped I/O to routine use of memory overcommitting, the
> resident set size is clearly a poor indicator of the actual amount
> of memory actively used by a complex process.

Hard to tell - first I would like to learn where the hundred-giga rss
came from...

--
Regards,
Tomasz Rola

--
** A C programmer asked whether computer had Buddha's nature.      **
** As the answer, master did "rm -rif" on the programmer's home    **
** directory. And then the C programmer became enlightened...      **
**                                                                 **
** Tomasz Rola          mailto:tomasz_rola@bigfoot.com             **