Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

heapviz

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heapviz

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Heapviz

Warning: This probably shouldn't be used for anything important. It requires patching and building a custom Ruby

Produces a png of a json dump of the Ruby objspace. Heap dump images are organised in rows and columns:

  • A heap page is a vertical column 4 pixels wide
  • A slot is a vertical chunk that is 4 pixels wide and (4*slot_size/sizeof(RVALUE)) tall. so 40 byte slots are 4x4 pixels, 80 bytes slots are 4x8 pixels, 160 bytes are 4x16 pixels and so on.

Running

This script requires a commit that recently landed on Ruby master to add a slot_size field to the output of ObjectSpace.dump_all. Use your Ruby version manager of choice to install the development release of Ruby and then write a script that dumps the heap to a file.

require 'objspace'
ObjectSpace.dump_all(output: File.new("output.json", "w"))

Run it with Ruby

./ruby test.rb

Then run this script with your json output, and a filename of a png to write to (the png doesn't need to exist)

../heapviz/exe/heapviz output.json output.png
open output.png

FAQs

Package last updated on 09 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc