How GC works in JavaScript engine

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

How GC works in JavaScript engine

GCタイミングを理解するために、オブジェクト生存期間とスコープについて簡単に説明します。

Akira Morikawa

June 26, 2018

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

34 slides
  1. GC: Mark And Sweep - Incremental GC - Stop-the-World しない

    - Write Barrier - Memory Fence - Concurrent Marking - Parallel Marking - V8 v6.4 (Chrome 64) でかなり高速化した https://v8project.blogspot.com/2018/06/concurrent-marking.html
  2. - GC: Mark And Sweep - GC は手動実行できない - root

    からの到達可能性をチェック - なるべくGCさせない事を意識する - 不要なオブジェクトを生成しない ← タイミングを知る - スコープに注意する - 関数内 var はローカルスコープ - var 指定なしはグローバルスコープ - const / let はブロックスコープ (ES6) - GC対象にするためには - Object に対しては null - Object.property に対しては delete まとめ

More Decks by Akira Morikawa

Other Decks in Technology