Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

Memory leak caused by setInterval #66

Description

@poying

It seems hardly to resolve this problem in normal way, but node-sleep + child_process may be an alternative solution.

// timer.js
var sleep = require('sleep').sleep;
while (1) {
  sleep(1);
  process.send('tick');
}

// reader.js
this.timer = child_process.fork('./timer');
this.timer.on('message', function (msg) {
  // poll
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions