logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

heapy - CLI for analyzing Ruby Heap dumps

Authors

       Heapy was written by Richard Schneeman. Initial code and idea was developed by Sam Saffron.

                                                 September 2018                                         HEAPY(1)

Description

heapy is a CLI for analyzing Heap dumps in Ruby. Start analyzing heap dumps of a command or files by:

           $ heapyread [file|command]

       Dumps from Ruby command can be analyzed by,

           $ heapyread <command>

       Heap dumps from files can also be analayzed,

           $ heapyread file.dump

            Generation: nil object count: 209191
            Generation:  18 object count: 805

       NOTE:  The reason of getting a "nil" generation is these objects were loaded into memory before your code
       began tracking the allocations. To ensure all allocations are tracked one should execute the ruby  script
       this trick.

       First create a file trace.rb that only starts allocation tracing:

           require 'objspace'

           ObjectSpace.trace_object_allocations_start

       Now  make sure this command is loaded before running the script, use Ruby's -I to specify a load path and
       -r to specify a library to require, in this case the trace file,

           $ ruby -I ./ -r trace script_name.rb

       If the last line of file is invalid JSON, make sure that file is closed file after writing the ruby  heap
       dump to it.

       To  analyze  a  specific  generation,  pass the generation number along with the command. For example, to
       analyze 17th generation in file.dump,

           $ heapyread file.dump 17

       To get all generations pass "all" directive

           $ heapyread file.dump all

Name

heapy - CLI for analyzing Ruby Heap dumps

Synopsis

heapyread [file|command] [number|all]

See Also