Home

Awesome

harb

A Heap Analyzer for Ruby. A tool that can be used to analyze Ruby JSON heap dumps that are generated by ObjectSpace.dump_all. Should build on OSX and Linux.

Building

make, or DEBUG=1 make for debugging.

Usage

harb <heap_dump_file>

Example

harb (master) $ ./harb heap_dump-1554816045-60.json
parsing (100%)
updating references (100%)
generating dominator tree (100%)
harb> help
You can run the following commands:

              quit - Exits the program
             print - Prints heap info for the address specified
          rootpath - Display the root path for the object specified
              idom - Print the immediate dominator for the object specified
        dominators - Print all objects dominated by the object specified
              help - Displays this message
           summary - Display a heap dump summary
              diff - Diff current heap dump with specifed dump

harb> print 0x55bfefa89e18
    0x55bfefa89e18: "STRING"
             value: "`created_at`"
           memsize: 40
  retained memsize: 40
            frozen: true
   referenced from: [
                      0x55bff09ae830 (HASH: size 50)
                    ]
harb> rootpath 0x55bfefa89e18
root path to 0x55bfefa89e18:
                      ROOT (vm)
                      0x55bfcfbf0bf0 (DATA: VM/thread)
                      0x55bfd23479d8 (DATA: fiber)
                      0x55bff09af258 (OBJECT: ActiveRecord::ConnectionAdapters::PedantMysql2Adapter)
                      0x55bff09ae830 (HASH: size 50)
                      0x55bfefa89e18 (STRING: "`created_at`")

Dependencies