Skip to content

Memory leak in setInterval + console.log + process.memoryUsage #2073

Closed
@EricTheOne

Description

@EricTheOne

The following code exhibits a growth in RSS and heap over time:

setInterval(function doLog() {
    console.log(process.memoryUsage());
}, 100);

leak1

Attached image made by excel - extract measurements from above script to clipboard then:

pbpaste | grep heapTotal | cut -d " " -f 3,5,7 | pbcopy 

Why is this happening?

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