Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ruby's bin men

Ruby's bin men

a whirlwind tour through the garbage collectors used in the rubies.

elise_huard

June 01, 2012
Tweet

More Decks by elise_huard

Other Decks in Programming

Transcript

  1. I am the smallest rails app! Here is my source

    code: %w(action_controller/railtie coderay).map &method(:require) run TheSmallestRailsApp ||= Class.new(Rails::Application) { config.secret_token = routes.append { root to: 'hello#world' }.inspect initialize! } class HelloController < ActionController::Base def world render inline: " <!DOCTYPE html> <title>The Smallest Rails App</title> <h3>I am the smallest rails app!</h3> <p>Here is my source code:</p> #{CodeRay.scan_file(__FILE__, :ruby).div(line_numbers: :table)} <a href='https://github.com/artemave/thesmallestrailsapp.com'>Make me smaller</a> " end end Make me smaller https://github.com/artemave/thesmallestrailsapp.com The smallest Rails app Friday, 1 June 12
  2. The smallest Rails app {:TOTAL=>351159, :FREE=>-8392, :T_OBJECT=>218, :T_CLASS=>894, :T_MODULE=>138, :T_FLOAT=>20,

    :T_STRING=>219091 :T_REGEXP=>489 :T_ARRAY=>22848 :T_HASH=>4896 :T_STRUCT=>76 :T_BIGNUM=>66 :T_FILE=>330 :T_DATA=>7502, :T_MATCH=>651, :T_COMPLEX=>0, :T_RATIONAL=>57, :T_NODE=>102163, :T_ICLASS=>112} Friday, 1 June 12
  3. • Nursery • Young generation • Mature generation • (Large

    objects) Generational GC Friday, 1 June 12
  4. • Generational: • Young (eden - Survivor1 - Survivor2) •

    Tenured • Permanent Area • minor/major garbage collection JVM Friday, 1 June 12
  5. #define GC_PROFILE_MORE_DETAIL 1 ... #define GC_NOTICE 1 22 GC during

    init with default ruby 1.9.3-rc1 Friday, 1 June 12
  6. • READ TEH CODES • read this: • read recent

    publications on garbage collection To know more Friday, 1 June 12