Add up the RSS column in ps and you can end up with more memory than the machine has. Shared libraries are counted again for every process that uses them.
smem reports a fairer figure, the PSS:
sudo apt install smem
smem -tk
PSS, the proportional set size, is the memory a process has to itself plus its share of what it splits with others. USS is only the private part. -t adds a totals line and -k prints units.
Group the result by user to see which account is the heavy one:
sudo smem -utk
Or limit the list to processes that match a pattern, handy for a program that starts many workers:
sudo smem -tk -P php-fpm
The total of the PSS column for those workers is a good estimate of what the whole group costs, which is the number I want when I decide how many workers a small server can hold.
Without sudo you only get full figures for your own processes. USS tells you roughly what you would get back by stopping one process, while PSS is better for totals, so pick the column that matches your question. The tool reads /proc for every process and can take a few seconds on a busy machine. It is also a snapshot, so a leak only shows when you run it several times.
Further reading: smem man page