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
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
63
Other Decks in Programming
See All in Programming
nilとは何か 〜interfaceの構造とnil!=nilから理解する〜
kuro_kurorrr
3
1.9k
20260315 AWSなんもわからん🥲
chiilog
1
140
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
140
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
260
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
8k
AIに任せる範囲を安全に広げるためにやっていること
fukucheee
0
130
株式会社 Sun terras カンパニーデック
sunterras
0
2.1k
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
15
8.6k
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
130
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
560
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
400
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
140
Featured
See All Featured
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
290
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.4k
GraphQLとの向き合い方2022年版
quramy
50
14k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
A designer walks into a library…
pauljervisheath
210
24k
Typedesign – Prime Four
hannesfritz
42
3k
We Have a Design System, Now What?
morganepeng
55
8k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2k
Raft: Consensus for Rubyists
vanstee
141
7.4k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
280
Building the Perfect Custom Keyboard
takai
2
710
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