Repository navigation
Silly program or memory leak? #2970
Description
Activity
Dupe of #1741.
- addedduplicateIssues and PRs that are duplicates of other issues or PRs.Issues and PRs that are duplicates of other issues or PRs.memoryIssues and PRs related to Node.js memory management or memory footprint.Issues and PRs related to Node.js memory management or memory footprint.
on Sep 20, 2015 Short answer: console output is buffered and async. Your console is slower then the script, and the buffer isn't limited by anything except for the global memory limit. So, it fills up the buffer and dies.
More info at #1741.For anyone picky enough: by «buffer» I mean the implicit buffer that is actually the async operation queue.
Reacted by Pouria Maleki, Revan Zhang, josephrocca, Abhinav Singi and LatpawReacted by subos2008, Matías Vallone and Thiago Morato@ChALkeR thanks for the short answer, it's easier to understand than the long one :)
@fivdi You could try to redirect the output to a file. It works for me as a work-around.
But this shouldn't be an issue if you are not firing writes to console faster then it could process them.- addedconsoleIssues and PRs related to the console subsystem.Issues and PRs related to the console subsystem.
on Sep 20, 2015 @ChALkeR thanks again. Redirecting the output to a file works around the issue for me too and is fine for what I want to achieve.
Although the following program is a little silly, it results in a "process out of memory" with Node.js v4.0.0 on a Linux system after a few minutes of execution.
Here's the output: