HEAPY(1)
β¨ HEAPY(1) β¨
okay bestie, gather round π this is heapy, a General Commands Manual page for a little CLI that reads Ruby Heap dumps. It's giving detective energy, it's giving "where did all my objects go", and honestly? Iconic. π΅οΈβοΈ
π NAME π
heapy β the CLI for analyzing Ruby Heap dumps. no cap. π¦
πΈ SYNOPSIS πΈ
heapy read [file|command] [number|all]
π DESCRIPTION π
heapy is a CLI for analyzing Heap dumps in Ruby. To start analyzing heap dumps of a command or files, you literally just do:
$ heapy read [file|command]
Dumps from a Ruby command can be analyzed by:
$ heapy read <command>
And heap dumps from files can also be analyzed, like:
$ heapy read file.dump
Generation: nil object count: 209191
Generation: 18 object count: 805
β οΈ NOTE: the reason you're getting a nil generation is that those objects were loaded into memory before your code started tracking the allocations. So to make sure every single allocation gets tracked, you should run your ruby script with 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 you run the script β use Ruby's -I to specify a load path and -r to specify a library to require, which in this case is the trace file:
$ ruby -I ./ -r trace script_name.rb
Also!</purl> if the last line of the file is invalid JSON, double check that the file is actually closed after you write the ruby heap dump to it. π«Ά
To analyze a specific generation, pass the generation number along with the command. For example, to analyze the 17th generation in file.dump:
$ heapy read file.dump 17
And to get all generations, pass the "all" directive:
$ heapy read file.dump all
π AUTHORS π
Heapy was written by Richard Schneeman. The initial code and the idea were developed by Sam Saffron. Two legends, fr fr. π
k that's the whole page bestie, mwah π This was the General Commands Manual for HEAPY(1), dated September 2018 β so yes it's a lil vintage but she still serves. Go analyze those dumps, you absolute main character. πβ¨ππ¦πΈ
π¦ where this page comes from
- debian bookworm: ruby-heapy 0.2.0-2 Β· MIT
- debian trixie: ruby-heapy 0.2.0-2 Β· MIT
- ubuntu jammy: ruby-heapy 0.2.0-1 Β· MIT
- ubuntu noble: ruby-heapy 0.2.0-2 Β· MIT
- ubuntu resolute: ruby-heapy 0.2.0-2 Β· MIT
- ubuntu stonking: ruby-heapy 0.2.0-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms