Try using pmap -x to watch the address space of your process
during the run.
The SZ is, I believe, just the total size of the virtual
memory segments taking no account of whether this memory
is backed by real physical memory or not.
If/when we access a page that is not mapped we will
pagefault to bring that page into physical memory
(from whereever it lives, or if this is anonymous memory
we'll arrange an anonymous page). The RSS will increment
whenever a new physical page is assigned to this process
address space in this sort of way.
If the process does not undo the mapping/allocation etc
then the RSS will not shrink unless memory pressure
(eg, from other applictions) requires that we free
some pages. If the process releases the pages they'll
be detached from it's address space and no longer reflect
in it's RSS.
I can't tell. Probably. But it's possible that the
appliction is mismanaging it's allocations, and (for
example) keeps using new buffers instead of reusing
RSS can never exceed the virtual size. It can equal it if we
touch every page in every segment and nobody forces the
release of any of these mappings (eg, plenty memory).
It makes more sense to watch the RSS of each segment
in the pmap -x output.
RSS on one process could increase while another decreases,
and system usage would stay the same. Watch the 'free'
column in vmstat output to see free physical memory.
You'd expect the process to grow to much the same pmap -x
output (including RSS) if asked to do the same thing
over and over (assuming no other memory pressure) and
restarting the process each time.