Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Grabage Collector in ruby, Why should I care ?
Search
Aboobacker MK
August 12, 2017
Programming
0
66
Grabage Collector in ruby, Why should I care ?
Ruby GC talk for Deccan ruby conf
Aboobacker MK
August 12, 2017
Tweet
Share
More Decks by Aboobacker MK
See All by Aboobacker MK
Conversational bots in ruby
tachyons
0
61
Other Decks in Programming
See All in Programming
Github Copilotのチャット履歴ビューワーを作りました~WPF、dotnet10もあるよ~ #clrh111
katsuyuzu
0
100
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.3k
認証・認可の基本を学ぼう後編
kouyuume
0
190
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
160
How Software Deployment tools have changed in the past 20 years
geshan
0
29k
JETLS.jl ─ A New Language Server for Julia
abap34
1
380
愛される翻訳の秘訣
kishikawakatsumi
2
320
大体よく分かるscala.collection.immutable.HashMap ~ Compressed Hash-Array Mapped Prefix-tree (CHAMP) ~
matsu_chara
2
220
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.3k
ハイパーメディア駆動アプリケーションとIslandアーキテクチャ: htmxによるWebアプリケーション開発と動的UIの局所的適用
nowaki28
0
420
俺流レスポンシブコーディング 2025
tak_dcxi
14
8.6k
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
330
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
8
1.3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Producing Creativity
orderedlist
PRO
348
40k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
It's Worth the Effort
3n
187
29k
Six Lessons from altMBA
skipperchong
29
4.1k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.7k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
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