Skip to content

nodejs addon memory leak. Maybe it is the problem of gc. #21441

@caijw

Description

@caijw
  • Version: 10.5.0 (maybe 10.x.x nodejs has this problem)
  • Platform: macOs 10.13
  • Subsystem:

I found that when writing nodejs addon to produce Buffer, memory leak will happen.
My test code is : https://github.com/caijw/test/tree/master/bufferLeak

Run the index.js in the bufferLeak folder. I found that the memory used in my pc grows and won't decrease.
before running:
image

after generate 250 buffers object:

image

and it keeps on consuming my pc's memory util i shut down this program.

Metadata

Metadata

Assignees

No one assigned

    Labels

    node-apiIssues and PRs related to the Node-API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions