Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Grabage Collector in ruby, Why should I care ?
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Aboobacker MK
August 12, 2017
Programming
69
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Grabage Collector in ruby, Why should I care ?
Ruby GC talk for Deccan ruby conf
Aboobacker MK
August 12, 2017
More Decks by Aboobacker MK
See All by Aboobacker MK
Conversational bots in ruby
tachyons
0
66
Other Decks in Programming
See All in Programming
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
6
2.5k
{ Android | Kotlin } Gradle Plugin in 2026
ryunen344
1
290
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
110
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
750
Press start. Python's next generation.
willingc
PRO
3
320
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.3k
iOS開発×AI駆動開発 〜最近使って便利だったスキルの話〜
nogu66
0
140
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
2
500
XHTMLが残したもの
yosuke_furukawa
PRO
2
430
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
180
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
460
信頼性の目標を誰も求めてない
shubox
0
490
Featured
See All Featured
A designer walks into a library…
pauljervisheath
211
25k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
410
[SF Ruby Conf 2025] Rails X
palkan
2
1.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Typedesign – Prime Four
hannesfritz
42
3.2k
Thoughts on Productivity
jonyablonski
76
5.4k
Darren the Foodie - Storyboard
khoart
PRO
3
3.9k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
770
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
58k
Chasing Engaging Ingredients in Design
codingconduct
0
300
Product Roadmaps are Hard
iamctodd
55
13k
Transcript
कचरा गोळा करणारा मी काळजी का क े ली पा
हजे 1
2
3 . 1
3 . 2
3 . 3
4
5
6
7
8
9
10
a = [ {c: 'd'} ] ... a = nil
11
12
13
14
a = [ {c: 'd'} ] 15
16
17
18
module GC def self.run mark sweep end def self.mark root_objects.each
do |root_obj| root_obj.associated_objects.each do |object| obj.update(marked: true) end end end def self.sweep objects.where(marked: false).destroy_all objects.update_all(marked: false) end end 19
20
21
22
23 . 1
23 . 2
24
25
26
module GC def self.run objects.update_all(color: white) clearly_living_objects.update_all(color: grey) objects.where(color: grey).each
do |object| object.references.update_all(color: grey) object.update(color: black) end objects.where(color: white).destroy_all end end 27
28
29
30
31
32
33 . 1
33 . 2
100_000.times do foo = "a string" end RETAINED = []
100_000.times do RETAINED << "a string" end 34
Model.all.each do |item| process(item) end Model.find_each do |item| process(item) end
Model.select(:id,:other, :necessary, :attributes) 35 . 1
class Thing; end list = Array.new(1000) { Thing.new } list.each
do |item| puts item end list = nil class Thing; end list = Array.new(1000) { Thing.new } while list.count > 0 puts list.pop end 35 . 2
36
37
38