Re: memory usage

Alexis <[email protected]> Mon, 04 May 2026 10:15:23 +1000
Newsgroups gmane.comp.shells.zsh.user
Message-ID <[email protected]>
Ray Andrews <[email protected]> writes:

> Is there some way of measuring zsh's entire footprint in=20
> memory?=C2=A0 I
> mean at creation of a shell, not while running anything.

You could use ps(1). Inside the shell, you could run:

  $ ps -q $$ -o comm,rss,vsize

where `$$` is a reference to the `$` variable, which contains the=20
PID of that shell. Outside that shell, replace `$$` by the PID of=20
the relevant shell as found by other means (e.g. via pgrep(1)):

  $ ps -q 1234 -o comm,rss,vsize

Here's an article explaining 'memory usage' as represented by=20
vsize/vsz and rss:

  https://linuxconfig.org/ps-output-difference-between-vsz-vs-rss-memory-us=
age


Alexis.