Skip to content

AdjustExternalMemory #52

@jasongin

Description

@jasongin

While porting the canvas package to NAPI, I found the canvas code calls Nan::AdjustExternalMemory() in a few places, to give some hints to the V8 GC. That NAN API is a wrapper around v8::Isolate::AdjustAmountOfExternalAllocatedMemory(). It's not critical for the functionality, but I assume it improves GC behavior significantly when working with large amounts of externally-allocated memory (image buffers in the case of canvas).

This is a V8-specific API; JSRT does not appear to have an equivalent. Do we need to expose it in NAPI? Possibly it could be implemented as a no-op on other engines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions