Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
> ObjectSpace.dump_all(output:"heap.json", "w"))
> `file heap.json`
=> "heap.json: ASCII text, with very long lines\n"
> `ls -al heap.json`
=> "-rw------- 1 u47788 47788 985808896 Mar 10 05:29 heap.json\n"
> `du -sh heap.json`
=> "941M\theap.json\n"
> `cat heap.json | ruby -rjson -ne ' obj = JSON.parse($_).values_at("file","line","type"); puts obj.join(":") if obj.first '> /dev/null`
/app/vendor/bundle/ruby/2.2.0/gems/json-1.8.2/lib/json/common.rb:155:in `parse': 757: unexpected token at '{"address":"0x7f9dd68e3f20", "type":"STRING", "class":"0x7f9dc82b0ee0", "embedded":true, "bytesiz' (JSON::ParserError)
from /app/vendor/bundle/ruby/2.2.0/gems/json-1.8.2/lib/json/common.rb:155:in `parse'
from -e:1:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment