Usually you cannot determine the memory usage of a thread, because ownership of the property can move freely between threads. Kernel mapping tables will show you the use of the process as a whole, that is, the memory allocated for all threads.
Programming threads is difficult. If you really do not need to freely exchange pointers and memory between threads, which is a rather unpleasant smell of code, then it will probably be easier to debug if you process your program as a flock of processes that exchange information via IPC, which also forces you to consider which should to be shared. As a bonus, if the ongoing process is relatively short-lived, the memory is returned to the system on exit() without the need to find and fix the leak.
source share