Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
Intel Customer Support will be observing the Martin Luther King holiday on Monday, Jan. 17, and will return on Tues. Jan. 18.
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646

tbbmalloc memory usage statistics

e4lam
Beginner
534 Views

It would really useful if there was some scalable_mallinfo() type of API similar to glibc's mallinfo() so that one can get some statistics of out the allocator.

0 Kudos
4 Replies
Alexei_K_Intel
Employee
537 Views

Can you clarify, please, which particular statistics (or which use cases) you are interested in?

e4lam
Beginner
537 Views

Things like how much system memory is being used vs how much the user has allocated would be a good start.

Alexei_K_Intel
Employee
537 Views

As for amount of used system memory, usually you do not need allocator support. You can read VmSize value from proc/status. Consider the example: https://github.com/intel/tbb/blob/tbb_2019/src/test/harness_memory.h#L57-L97

As for amount of user allocated memory, it is interesting problem. It might be not so easy to calculate it in concurrent environment without additional overhead when threads are dynamically created and destroyed.

 

e4lam
Beginner
537 Views

Reading the VmSize is something we're already doing but it's not accurate in terms of how much system memory that tbbmalloc is using, right?

I appreciate the difficulty in the presence of parallel allocation and deallocations. Perhaps this page is a better analogy which discusses this type of functionality in jemalloc: https://github.com/jemalloc/jemalloc/wiki/Use-Case%3A-Basic-Allocator-Statistics ;

Reply