I want to check the contribution of process threads to the process’ RSS, VSZ and SZ values. How can I do this.
Because if I do this:
ps w -eL -o pid,tid,%cpu,cputime,%mem,sz,rss,vsz,command
I get the tid, but all other values for all the threads of a process are the same. Can I even do this using ps?
Threads don’t have individual contribution to resident and virtual size since they share memory by definition. As for the areas that happen to be in use by a single thread and never shared with other threads, the kernel doesn’t know about that. This is why ps shows the same values for all threads in a process.