How to find out the memory usage of threads?

Is it possible to find out how much memory is being used by a given phtread thread? I'm interested in information like VmRSS.

+3
source share
3 answers

Each thread consumes a stack that has a fixed size and is created when the thread starts. Usually it is 512 K / 1M, but at startup it is only a virtual size.

However, for dynamically distributed data (malloc) this is information about the volume of the process, not streaming. Please note that some alternative malloc implementations (e.g. tcmalloc) may provide more advanced statistics.

+5
source

, , free(),

0

pthread, , 10 . .

, pthread_attr_setstacksize(). , script, "checkstack.pl". Linux ( "scripts" ).

. http://www.kegel.com/stackcheck

0

Source: https://habr.com/ru/post/1706898/


All Articles