c++tcmallocgoogle-perftools

how to get tcmalloc static of all class


I am using tcmalloc lib for my application and I want to get all class information like how many object of that class, total size etc .

There is one function DumpStats that give us all information(class information, page heap information, total memory allocation summary etc). This API will give information in string and I don't want to parse this to get the information i want.

Is there similar API to just get all the class(bucket) information. Please let me know if the question is not clear.


Solution

  • There is no direct way. Only way is to call GetStats()(Expose by TCMalloc) function and then use string parse to get class related information.