sigdump icon indicating copy to clipboard operation
sigdump copied to clipboard

Idea: memsize_of() info for each classes.

Open ko1 opened this issue 5 years ago • 0 comments

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...

ko1 avatar May 14 '19 02:05 ko1