Skip to main content

Heap SpaceV8 organize Heap into Page regions to work with Garbage Collector

aka Space, Spaces

Memory Page

Virtual Memory Block, fixed-length contigious, ref by Page Table

New-space

Small Heap Space to contain most objects, independent of other Spaces, for fast Garbage-Collection

Old-pointer-space

Space to contain most objects with Pointers to other objects, moved here from New-space

Old-data-space

Space to contain objects with raw data (no Pointers). Strings, boxed numbers, and arrays of unboxed doubles move here from New-space for a while.

Large-object-space

Space to contain large objects above size limits of other Spaces. Each object assign mmap'd region of memory. Large objects never moved by Garbage Collector.

Code-space

Space to contain JIT Compiled Code objects for executable memory (may also allocate inside Executable JIT Code in Large-object-space)

Cell-space, property-cell-space and map-space

Spaces to contain Cells, PropertyCells, and Maps, respectively. Each Space contains same sized objects with some constraints on type of objects to point to, to simplify Garbage-Collection.

References

  1. New-space ↔ Small Heap Space to contain most objects, independent of other Spaces, for fast Garbage-Collection

  2. Old-pointer-spaceSpace to contain most objects with Pointers to other objects, moved here from New-space

  3. Old-data-spaceSpace to contain objects with raw data (no Pointers). Strings, boxed numbers, and arrays of unboxed doubles move here from New-space for a while.

  4. Large-object-spaceSpace to contain large objects above size limits of other Spaces. Each object assign mmap'd region of memory. Large objects never moved by Garbage Collector.

  5. Code-spaceSpace to contain JIT Compiled Code objects for executable memory (may also allocate inside Executable JIT Code in Large-object-space)

  6. Cell-space, property-cell-space and map-spaceSpaces to contain Cells, PropertyCells, and Maps, respectively. Each Space contains same sized objects with some constraints on type of objects to point to, to simplify Garbage-Collection.