Skip to content

Instantly share code, notes, and snippets.

# This is a Rails app that's just started and handled one request. The
# first column is where the objects place as far as memory consumption.
# The second column is the object count, and the third column is total
# memory consumption. Note that this does not include objects that
# these objects reference, like the instance variable table (an array)
# or DataWrapStruct objects, but that's also available through other
# tools like jhat (Java Heap Analysis Tool).
# Command line for this output: jmap -histo:live 25175 | grep " ruby."
~/projects/jruby ➔ jruby -J-Djruby.backtrace.style=rubinius -e "def foo; bar; end; def bar; baz; end; def baz; raise; end; foo"
An exception has occurred:
No current exception (RuntimeError)
Backtrace:
Kernel#raise at -e:1
Object#baz at -e:1
Object#bar at -e:1
Object#foo at -e:1
(unknown)#(unknown) at :1
LoadService: trying builtinLib: nonex.class
LoadService: trying builtinLib: nonex.rb
LoadService: trying resourceFromLoadPath: '/Users/headius/projects/jruby/lib/ruby/gems/1.8/gems/activesupport-3.0.0.beta4/bin/nonex.class' false false
LoadService: trying resourceFromLoadPath: '/Users/headius/projects/jruby/lib/ruby/gems/1.8/gems/activesupport-3.0.0.beta4/bin/nonex.rb' false false
LoadService: trying resourceFromLoadPath: '/Users/headius/projects/jruby/lib/ruby/gems/1.8/gems/activesupport-3.0.0.beta4/lib/nonex.class' false false
LoadService: trying resourceFromLoadPath: '/Users/headius/projects/jruby/lib/ruby/gems/1.8/gems/activesupport-3.0.0.beta4/lib/nonex.rb' false false
LoadService: trying resourceFromLoadPath: '/Users/headius/projects/jruby/lib/ruby/gems/1.8/gems/builder-2.1.2/bin/nonex.class' false false
LoadService: trying resourceFromLoadPath: '/Users/headius/projects/jruby/lib/ruby/gems/1.8/gems/builder-2.1.2/bin/nonex.rb' false false
LoadService: trying resourceFromLoadPath: '/Users/headius/projects
~/projects/jruby/sinatra-app ➔ cat config.ru
require 'rubygems'
require 'hello_world'
set :run, false
set :environment, :production
run Sinatra::Application
~/projects/jruby/sinatra-app ➔ cat hello_world.rb
require 'rubygems'
require 'sinatra'
~/projects/jruby ➔ jruby -rbenchmark -rjruby -e "20.times { puts Benchmark.realtime {JRuby.parse(File.read('test/mri/sample/test.rb'))} }"
0.175999879837036
0.285000085830688
0.0899999141693115
0.200000047683716
0.0619997978210449
0.0669999122619629
0.11899995803833
0.0900001525878906