sigdump
sigdump copied to clipboard
Idea: memsize_of() info for each classes.
ObjectSpace.memsize_of(o) returns memory size information of the object o. This patch shows the total memsize with object counts for each classes.
All objects:
1: Thread (1,049,200)
11,318: String (572,424)
361: Class (287,296)
16: File (134,784)
141: Regexp (120,633)
85: Hash (94,208)
39: Module (48,816)
729: Array (41,936)
...
Total memsize info are in parenthesises.
Note that ObjectSpace.memsize_of() can return wrong size information. For example, if string objects shared the buffer with others, it returns some strange information. Also T_DATA (data typs defined by C-extensions) may not return its size information.
Note2: The output seems too bad...