Upgrade to Pro — share decks privately, control downloads, hide ads and more …

V8 Minor GC

Deepu K Sasidharan
January 26, 2020
91k

V8 Minor GC

Deepu K Sasidharan

January 26, 2020
Tweet

Transcript

  1. Minor GC (Scavenge)
    1. Let us assume that there are already objects on the “to-space” when we
    start(Blocks 01 to 06 marked as used memory)
    2. The process creates a new object(07)
    3. V8 tries to get required memory from the from-space, but there is no free
    space in there to accommodate our object and hence V8 triggers minor GC

    View full-size slide

  2. Minor GC
    Heap memory
    New space (Young generation)
    Old generation
    (Old space)
    Pointer space
    Orphan Used memory Free memory
    Large object space Code space
    Cell space
    Property cell space
    Map space
    Data space
    From-space To-space
    01 02 03
    04
    05 06
    07
    (new object)

    View full-size slide

  3. Minor GC
    Heap memory
    New space (Young generation)
    Old generation
    (Old space)
    Pointer space
    Orphan Used memory Free memory
    Large object space Code space
    Cell space
    Property cell space
    Map space
    Data space
    From-space To-space
    01
    02 03
    04
    05 06
    07
    (new object)

    View full-size slide

  4. Minor GC
    Heap memory
    New space (Young generation)
    Old generation
    (Old space)
    Pointer space
    Orphan Used memory Free memory
    Large object space Code space
    Cell space
    Property cell space
    Map space
    Data space
    From-space To-space
    01
    02 03
    04
    05
    06
    07
    (new object)

    View full-size slide

  5. Minor GC
    Heap memory
    New space (Young generation)
    Old generation
    (Old space)
    Pointer space
    Orphan Used memory Free memory
    Large object space Code space
    Cell space
    Property cell space
    Map space
    Data space
    From-space To-space
    01
    02 03
    04
    05
    06
    07
    (new object)

    View full-size slide

  6. Minor GC
    Heap memory
    New space (Young generation)
    Old generation
    (Old space)
    Pointer space
    Orphan Used memory Free memory
    Large object space Code space
    Cell space
    Property cell space
    Map space
    Data space
    To-space From-space
    01 03 05
    07
    (new object)

    View full-size slide

  7. Minor GC
    Heap memory
    New space (Young generation)
    Old generation
    (Old space)
    Pointer space
    Orphan Used memory Free memory
    Large object space Code space
    Cell space
    Property cell space
    Map space
    Data space
    To-space From-space
    01 03 05
    07
    (new object)

    View full-size slide

  8. Second Minor GC
    1. Let us assume that some time have passed and there are more objects on
    the “from-space” now(Blocks 07 to 09 marked as used memory)
    2. The process creates a new object(10)
    3. V8 tries to get required memory from the from-space, but there is no free
    space in there to accommodate our object and hence V8 triggers second
    minor GC

    View full-size slide

  9. Minor GC
    Heap memory
    New space (Young generation)
    Old generation
    (Old space)
    Pointer space
    Orphan Used memory Free memory
    Large object space Code space
    Cell space
    Property cell space
    Map space
    Data space
    To-space From-space
    01 03 05
    07 08 09
    10
    (new object)

    View full-size slide

  10. Minor GC
    Heap memory
    New space (Young generation)
    Old generation
    (Old space)
    Pointer space
    Orphan Used memory Free memory
    Large object space Code space
    Cell space
    Property cell space
    Map space
    Data space
    To-space From-space
    01
    03
    05
    07
    08
    09
    10
    (new object)

    View full-size slide

  11. Minor GC
    Heap memory
    New space (Young generation)
    Old generation
    (Old space)
    Pointer space
    Orphan Used memory Free memory
    Large object space Code space
    Cell space
    Property cell space
    Map space
    Data space
    To-space From-space
    01
    03
    05
    07
    08
    09
    10
    (new object)

    View full-size slide

  12. Minor GC
    Heap memory
    New space (Young generation)
    Old generation
    (Old space)
    Pointer space
    Orphan Used memory Free memory
    Large object space Code space
    Cell space
    Property cell space
    Map space
    Data space
    From-space To-space
    01
    05
    07 09
    10
    (new object)

    View full-size slide

  13. Minor GC
    Heap memory
    New space (Young generation)
    Old generation
    (Old space)
    Pointer space
    Orphan Used memory Free memory
    Large object space Code space
    Cell space
    Property cell space
    Map space
    Data space
    From-space To-space
    01
    05
    07 09
    10
    (new object)

    View full-size slide