Skip to content

Instantly share code, notes, and snippets.

@headius
Created August 2, 2019 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/a867e0831dc1c3375ec1874e5529e724 to your computer and use it in GitHub Desktop.
Save headius/a867e0831dc1c3375ec1874e5529e724 to your computer and use it in GitHub Desktop.
Using JVM tools to profile Ruby objects with JRuby 9.2.8
$ jruby -J-Xrunhprof:depth=0 -Xreify.variables.name -S gem list > /dev/null
Dumping Java heap ... allocation sites ... done.
$ grep ' org.jruby.gen' java.hprof.txt
56 0.24% 83.26% 325440 5803 328520 5858 300000 org.jruby.gen.Gem.Dependency
59 0.22% 83.93% 299248 9336 333840 10417 300000 org.jruby.gen.Gem.Requirement
60 0.22% 84.15% 294472 1268 294472 1268 300000 org.jruby.gen.Gem.Specification
99 0.08% 89.15% 111320 1260 111408 1261 300000 org.jruby.gen.Gem.StubSpecification
142 0.05% 92.03% 71032 1260 71088 1261 300000 org.jruby.gen.Gem.StubSpecification.StubLine
197 0.03% 94.14% 33960 598 33960 598 300000 org.jruby.gen.Gem.Version
226 0.02% 94.77% 25688 630 25688 630 300000 org.jruby.gen.Gem.NameTuple
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment