Skip to content

[Feat]Iterative/non-blocking memory reclaim #154

@Bnaya

Description

@Bnaya

Current situation:
The memory reclaim is a blocking operation, of walking on the graph collect addresses to free into an array,
and then call allocator's free on them.
This process can be long, and blocks the process that doing do.

Proposal:
Write a non-blocking, iterative impl of the same code (can be generator based)
The code is written in a way to can be easily refactored to also support iterative variant, that will be to yield the main thread.
The scheduling of the iterations will be left to the user, that can use https://www.npmjs.com/package/scheduler or other direct api: https://www.chromestatus.com/feature/6031161734201344

While the whole operation will take longer, we will not freeze the main thread.

Need to take into account: If more addresses will be added to the "to free list"

Where to start?
See the processQueuedReclaims api function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions