anakreon wrote:
Hello.
Is there any tool which could help finding out which objects consume
most of the memory?
I was thinking something which would generate a report like:
ClassA 120003 instances 3MB
ClassB 4550 instances 1MB
and so on.
I used massif of valgrind but it doesn't do what I need.
Thanks for your reply
Tools: No idea.
If you asking about the class size, then use sizeof operator, count your
object. Sccot Meyers has article on this issue, check out his homepage
If you meant there are pointers inside of classes, and you want to add
the size of what the pointer points not add the size of an pointer, it's
more complicated, not only the pointer issue, but also some recursive
calculation; as an clue, you have to apply some extra mechanism shipped
with you platform, like VC, we can use _CheckMemState. But I think it's
hard.
--
Thanks
Barry