How can we know which process is using how much memory individually?
The problem of determining how much memory an individual process consumes is an open one, and mainly based on definition.
The issue in large part arises from shared libraries - how would you calculate the memory usage of a process which uses the same .so as 3 other processes ? would you say it consumes the entire memory the lib is allocated, as it couldn't function without it? would you say it consumes the proportional part (1/4, as there are 3 other procs which use it concurrently - pss)? would you say the process is independent of any libraries it loads in order to run?
Would you include swapped out memory, or only physical ram resident pages? What about multiple threads, or child processes? Forks use the same memory as their parent as long as no change is made - would you count that memory allocation for each process or only for the parent?
This question has been asked and answered here and in other sites many times, so I'll just give a few links and a general conclusion.
First the most quoted article on the subject - https://emilics.com/notebook/enblog/p871.html
A few SO and U&L questions on the same subject:
Correctly determining memory usage in Linux
In conclusion -
/prc/[pid]/smap as per the doc
The /proc/PID/smaps is an extension based on maps, showing the memory consumption for each of the process's mappings.
Or use the pmap command.