← Graph

Toolbelt of a Seasoned Bug Hunter

talk 22 connections

Damir Zekić's wroclove.rb 2018 talk subtitled '2016: A Debugging Odyssey in Six Chapters with an Epilogue'. Recounts debugging a silent performance bug where a Rails app using Spring and Guard slowed down more and more on every code reload. Walks through: (1) reproducing the bug, (2) git bisect plus a custom linear-search Ruby script to find the first bad commit (complicated by missing bundle install, missing db:migrate, and a deleted colleague's personal JS gem), (3) hypothesizing a memory leak and using heap dumps and the heapy gem, learning that Ruby doesn't return memory to the OS and observing suspiciously long-lived class DSL objects, (4) rendering rails-startup flame graphs across multiple boots (Safari could open them when Chrome crashed) and spotting a growing function in ActionDispatch::Routing::RouteSet#clear, (5) digging into Rails code to find it clears and rebuilds the URL/path helper modules on every reload, then benchmarking undef_method scaling super-linearly, and diving into Ruby's C source where undef_method adds a placeholder method and spends half its time clearing the method cache, (6) rooting it in the 'monolith' framework mounting business-action controllers at boot, surviving Spring's fork, and accumulating across reloads. Closes with the lesson 'Know thy app' (including your framework and libraries) and an epilogue about ActiveSupport's DescendantsTracker keeping classes alive. Also announces 'granite' — the open-sourced successor to 'monolith' — as a business-actions architecture gem.

type
talk
talk Toolbelt of a Seasoned Bug Hunter
about
Spring tool
Spring's preloader/fork model is central to the reload-slowdown bug investigated.
talk Toolbelt of a Seasoned Bug Hunter
about
Guard tool
The bug was observed through Guard's test re-runs after file changes.
talk Toolbelt of a Seasoned Bug Hunter
about
git bisect tool
Speaker explains and uses git bisect as a first-line debugging tool.
talk Toolbelt of a Seasoned Bug Hunter
about
Speaker wrote a custom Ruby script to linearly walk git history when no good commit was known.
talk Toolbelt of a Seasoned Bug Hunter
about
Uses Ruby's built-in heap-dump facility to investigate a suspected memory leak.
talk Toolbelt of a Seasoned Bug Hunter
about
heapy tool
Uses the heapy gem to analyze heap dumps across GC generations.
talk Toolbelt of a Seasoned Bug Hunter
about
Explains that Ruby does not return freed memory to the OS, complicating leak diagnosis.
talk Toolbelt of a Seasoned Bug Hunter
about
Flame Graphs concept
Renders flame graphs of Rails startup to compare successive boots and locate the growing function.
talk Toolbelt of a Seasoned Bug Hunter
about
Traces the slowdown to RouteSet#clear undef_methoding URL/path helpers on every reload.
talk Toolbelt of a Seasoned Bug Hunter
about
Benchmarks and source-dives undef_method, showing super-linear cost and method-cache clearing overhead.
talk Toolbelt of a Seasoned Bug Hunter
about
Root cause of the bug was monolith's boot-time controller mounting.
talk Toolbelt of a Seasoned Bug Hunter
about
granite project
Publicly announces granite as the open-sourced successor to monolith.
talk Toolbelt of a Seasoned Bug Hunter
about
Epilogue highlights ActiveSupport::DescendantsTracker as a framework cause of classes never being GC'd.
talk Toolbelt of a Seasoned Bug Hunter
about
The app under debugging is a monolithic Rails application.
talk Toolbelt of a Seasoned Bug Hunter
about
Ruby tool
Deep dive into Ruby internals (undef_method, ObjectSpace, memory behavior).
asked_at
Toolbelt of a Seasoned Bug Hunter talk
Q&A question at the end of the talk.
person Damir Zekić
authored
Toolbelt of a Seasoned Bug Hunter talk
Delivered the talk at wroclove.rb 2018.
takeaway Know thy app
from_talk
Toolbelt of a Seasoned Bug Hunter talk
Closing lesson of the talk.
from_talk
Toolbelt of a Seasoned Bug Hunter talk
Concrete fix identified at the end of the debugging odyssey.
from_talk
Toolbelt of a Seasoned Bug Hunter talk
Repeated pattern throughout the debugging odyssey.
from_talk
Toolbelt of a Seasoned Bug Hunter talk
Caveat highlighted during the git bisect chapter.
talk Toolbelt of a Seasoned Bug Hunter
presented_at
Talk given at wroclove.rb 2018 on 2018-03-16.

Provenance

Created
2026-04-17 16:17 seed
Read by
24 extractions