Realtime Class Usage Monitoring

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Qm9iUGl0YnVsbA==?=

    Realtime Class Usage Monitoring

    Suppose that my base class is A and I have classes B, C and D deriving from
    A. I then have B2 deriving from B and C2 deriving from C... and B3 deriving
    from B2.

    Then... suppose that I have some objects:-

    3 objects of class A.
    5 objects of class B.
    6 objects of class C.
    12 objects of class D.
    4 objects of class B2.
    5 objects of class C2.
    6 objects of class B3.

    Since all classes derive from A, it means that I actually have 41 objects
    whose base class is A. Plus, 15 who derive from B and 11 deriving from C...

    I'd like to be able to output all of this information into a realtime list,
    something like

    A 41 (3+15+11+12)
    |--B // 15 (5+10)
    |--B2 // 10 (4+6)
    |--B3 // 6
    |--C // 11 (6+5)
    |--C2 // 5
    |--D // 12

    This data would effectively be represented in several columns, including
    "inclusive count", "exclusive count", "inclusive memsize", "exclusive
    memsize".

    This would make it easier for us to optimise our memory usage as we would be
    able to see which classes as costing us the most memory ... in a format which
    we can easily analyse.

    That brings me to my question.... is there an easy way to find out that data
    at runtime? For a project that could have potentially 10s of thousands of
    classes? I have access to all the allocated objects - that parts easy.
    Splitting them into "what they are" and "what they derive from" isn't so
    easy... or is it?

    Thanks for any help,
    Robert
Working...