SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
javascript
Garbage Collector
Overview
: @brn ( )
: iOS 
: Cyberagent RightSegment AI Messenger
: http://abcdef.gets.b6n.ch/
What is Garbage Collector?
Garbage Collector
What is Garbage Collector?
var	x	=	{	
		a:	1,	
		b:	2	
}
Object	
Field a	
Field b	
Other Objects	
Heap
What is Heap?
Stack
=
Heap
What is Heap?
Stack

Heap 
javascript Heap Stack
What is Heap?
Stack	
Process
Stack	 Heap	
Process
Stack	 Heap	
Process
( )
What is Heap?
OUT OF MEMORY
Garbage Collector
Heap 

Garbage Collector
Garbage Collector
var	x	=	{}	
var	y	=	{}	
Heap
Global	
x	 y
Garbage Collector
Garbage Collector Heap
Heap
Global	
x	 y
Garbage Collector
var	x	=	{}	
var	y	=	{}	
y	=	null	
Heap
Global	
x	 y
Garbage Collector
Garbage Collector Heap
Heap
Global	
x	 y
Garbage Collector
var	x	=	{};	
var	y	=	{x:	x};	
x	=	null	
y.x	=	null	
Heap
Global	
x	 y
Garbage Collector
Garbage Collector Heap
Heap
Global	
x	 y
Garbage Collector
var	x	=	{};	
var	y	=	{x:	x};	
x	=	null	
y	=	null	
Heap
Global	
x	 y
Garbage Collector
Garbage Collector Heap
Heap
Global	
x	 y
Garbage Collector
Heap
Global	
x	 y	
Garbage Collector Heap
Garbage Collector
Garbage Collector Heap 
(Mark Phase)

Garbage Collector Heap 
(Sweep Phase)
Garbage Collector

(Mark And Sweep)
Garbage Collector
MarkPhase SweepPhase 




GC(Incremental GC)


Mark&Sweep 
Stop the world
Incremental Garbage Collection
Garbage Collector Heap
Heap
Global	
x	 y	
中断
Incremental Garbage Collection
Garbage Collector Heap
Heap
Global	
x	 y	
中断
Incremental Garbage Collection
Incremental GC Mark Phase 
(WriteBarrier)
Incremental Garbage Collection
var	x	=	{}	
var	y	=	{}	
y.x	=	x;	
Object(x)	
Heap
Object(y)	
WRITED
Incremental Garbage Collection
Garbage Collector WriteBarrier
Heap
Global	
x	 y
中断
WRITED
削除しない
Incremental Garbage Collection
Incremental GC 
GC
Summary

GC 

https://github.com/authorNari/minigc 449 miniGC



https://www.amazon.co.jp/%E3%82%AC%E3%83%99%E3%83%BC%E3%82%B8%E3%82%B3%E3%83%AC
%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AE%E3%82%A2%E3%83%AB
%E3%82%B4%E3%83%AA%E3%82%BA%E3%83%A0%E3%81%A8%E5%AE%9F%E8%A3%85-%E4%B8%AD%E6%9D
%91-%E6%88%90%E6%B4%8B/dp/4798025623
JavascriptのGC入門

Contenu connexe

Tendances

SOTM10 lightning talk : BMO differential import
SOTM10 lightning talk : BMO  differential importSOTM10 lightning talk : BMO  differential import
SOTM10 lightning talk : BMO differential import
fvanderbiest
 

Tendances (6)

Ruby memory tips and tricks
Ruby memory tips and tricksRuby memory tips and tricks
Ruby memory tips and tricks
 
Python memory managment. Deeping in Garbage collector
Python memory managment. Deeping in Garbage collectorPython memory managment. Deeping in Garbage collector
Python memory managment. Deeping in Garbage collector
 
Ragel talk
Ragel talkRagel talk
Ragel talk
 
Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools
 
SOTM10 lightning talk : BMO differential import
SOTM10 lightning talk : BMO  differential importSOTM10 lightning talk : BMO  differential import
SOTM10 lightning talk : BMO differential import
 
Into to OpenStreetMap, July 2011
Into to OpenStreetMap, July 2011Into to OpenStreetMap, July 2011
Into to OpenStreetMap, July 2011
 

Similaire à JavascriptのGC入門

Александр Терещук - Memory Analyzer Tool and memory optimization tips in Android
Александр Терещук - Memory Analyzer Tool and memory optimization tips in AndroidАлександр Терещук - Memory Analyzer Tool and memory optimization tips in Android
Александр Терещук - Memory Analyzer Tool and memory optimization tips in Android
UA Mobile
 

Similaire à JavascriptのGC入門 (20)

Automatically Tolerating And Correcting Memory Errors
Automatically Tolerating And Correcting Memory ErrorsAutomatically Tolerating And Correcting Memory Errors
Automatically Tolerating And Correcting Memory Errors
 
Garbage collection
Garbage collectionGarbage collection
Garbage collection
 
Garbage Collection In Micorosoft
Garbage Collection In  MicorosoftGarbage Collection In  Micorosoft
Garbage Collection In Micorosoft
 
Tomasz Nurkiewicz - Programowanie reaktywne: czego się nauczyłem
Tomasz Nurkiewicz - Programowanie reaktywne: czego się nauczyłemTomasz Nurkiewicz - Programowanie reaktywne: czego się nauczyłem
Tomasz Nurkiewicz - Programowanie reaktywne: czego się nauczyłem
 
Garbage Collection in Java.pdf
Garbage Collection in Java.pdfGarbage Collection in Java.pdf
Garbage Collection in Java.pdf
 
MongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB PerformanceMongoDB Europe 2016 - Debugging MongoDB Performance
MongoDB Europe 2016 - Debugging MongoDB Performance
 
Garbage collection
Garbage collectionGarbage collection
Garbage collection
 
Talking trash
Talking trashTalking trash
Talking trash
 
Javascript The Good Parts v2
Javascript The Good Parts v2Javascript The Good Parts v2
Javascript The Good Parts v2
 
Александр Терещук - Memory Analyzer Tool and memory optimization tips in Android
Александр Терещук - Memory Analyzer Tool and memory optimization tips in AndroidАлександр Терещук - Memory Analyzer Tool and memory optimization tips in Android
Александр Терещук - Memory Analyzer Tool and memory optimization tips in Android
 
Let's talk about Garbage Collection
Let's talk about Garbage CollectionLet's talk about Garbage Collection
Let's talk about Garbage Collection
 
Jose Selvi - Side-Channels Uncovered [rootedvlc2018]
Jose Selvi - Side-Channels Uncovered [rootedvlc2018]Jose Selvi - Side-Channels Uncovered [rootedvlc2018]
Jose Selvi - Side-Channels Uncovered [rootedvlc2018]
 
Soft Shake Event / A soft introduction to Neo4J
Soft Shake Event / A soft introduction to Neo4JSoft Shake Event / A soft introduction to Neo4J
Soft Shake Event / A soft introduction to Neo4J
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
How & why-memory-efficient?
How & why-memory-efficient?How & why-memory-efficient?
How & why-memory-efficient?
 
There is garbage in our code - Talks by Softbinator
There is garbage in our code - Talks by SoftbinatorThere is garbage in our code - Talks by Softbinator
There is garbage in our code - Talks by Softbinator
 
Javascript status 2016
Javascript status 2016Javascript status 2016
Javascript status 2016
 
Identifying memory leaks in Android applications
Identifying memory leaks in Android applicationsIdentifying memory leaks in Android applications
Identifying memory leaks in Android applications
 
Let's Get to the Rapids
Let's Get to the RapidsLet's Get to the Rapids
Let's Get to the Rapids
 
A Re-Introduction to JavaScript
A Re-Introduction to JavaScriptA Re-Introduction to JavaScript
A Re-Introduction to JavaScript
 

Plus de Taketoshi 青野健利

Plus de Taketoshi 青野健利 (10)

ServiceWorkerとES6 Modules時代のTypescript開発考察
ServiceWorkerとES6 Modules時代のTypescript開発考察ServiceWorkerとES6 Modules時代のTypescript開発考察
ServiceWorkerとES6 Modules時代のTypescript開発考察
 
javascriptのデータ構造の話
javascriptのデータ構造の話javascriptのデータ構造の話
javascriptのデータ構造の話
 
V8 javascript engine for フロントエンドデベロッパー
V8 javascript engine for フロントエンドデベロッパーV8 javascript engine for フロントエンドデベロッパー
V8 javascript engine for フロントエンドデベロッパー
 
非同期javascriptの過去と未来
非同期javascriptの過去と未来非同期javascriptの過去と未来
非同期javascriptの過去と未来
 
仮想DOMの実装とパフォーマンス
仮想DOMの実装とパフォーマンス仮想DOMの実装とパフォーマンス
仮想DOMの実装とパフォーマンス
 
V8 Iginition Interpreter
V8 Iginition InterpreterV8 Iginition Interpreter
V8 Iginition Interpreter
 
GraphQL with React
GraphQL with ReactGraphQL with React
GraphQL with React
 
Jspmとtypescriptで開発する
Jspmとtypescriptで開発するJspmとtypescriptで開発する
Jspmとtypescriptで開発する
 
React and-rx
React and-rxReact and-rx
React and-rx
 
WebWorker and Atomics
WebWorker and AtomicsWebWorker and Atomics
WebWorker and Atomics
 

Dernier

AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
Alluxio, Inc.
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
Max Lee
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
mbmh111980
 

Dernier (20)

The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdfThe Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
 
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
Facemoji Keyboard released its 2023 State of Emoji report, outlining the most...
 
What need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java DevelopersWhat need to be mastered as AI-Powered Java Developers
What need to be mastered as AI-Powered Java Developers
 
AI Hackathon.pptx
AI                        Hackathon.pptxAI                        Hackathon.pptx
AI Hackathon.pptx
 
Microsoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdfMicrosoft365_Dev_Security_2024_05_16.pdf
Microsoft365_Dev_Security_2024_05_16.pdf
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
Tree in the Forest - Managing Details in BDD Scenarios (live2test 2024)
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
AI/ML Infra Meetup | Improve Speed and GPU Utilization for Model Training & S...
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
Workforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdfWorkforce Efficiency with Employee Time Tracking Software.pdf
Workforce Efficiency with Employee Time Tracking Software.pdf
 
JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)JustNaik Solution Deck (stage bus sector)
JustNaik Solution Deck (stage bus sector)
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAGAI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
AI/ML Infra Meetup | Reducing Prefill for LLM Serving in RAG
 
CompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdfCompTIA Security+ (Study Notes) for cs.pdf
CompTIA Security+ (Study Notes) for cs.pdf
 
A Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data MigrationA Guideline to Zendesk to Re:amaze Data Migration
A Guideline to Zendesk to Re:amaze Data Migration
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdf
 

JavascriptのGC入門