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

V8 Minor GC

Deepu K Sasidharan
January 26, 2020
99k

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
  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)
  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)
  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)
  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)
  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)
  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)
  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
  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)
  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)
  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)
  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)
  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)