This is a adaptation of some of the ObjectSpace.dump_all
analyisis scripts found in Sam Saffron's article on "Debugging memory leaks in Ruby":
https://samsaffron.com/archive/2015/03/31/debugging-memory-leaks-in-ruby
The input files are also generated in a similar fashion that is described in the blog post:
io=File.open("/tmp/my_dump", "w")
ObjectSpace.dump_all(output: io);