Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Memory leak in NodeJS for Windows #25816

Closed
nekdolan opened this issue Aug 6, 2015 · 2 comments
Closed

Memory leak in NodeJS for Windows #25816

nekdolan opened this issue Aug 6, 2015 · 2 comments

Comments

@nekdolan
Copy link

nekdolan commented Aug 6, 2015

OS Windows 7 (does not leak in OSX)
NodeJS 0.12.2
Coffeescript 1.9.3

Not sure why this leaks but it is really bad

boo = ->
  newPoints = (1 for index in [0..2])
  1

boo2 = ->
  i = 1000
  while i -= 1 >= 0
    boo()
  setTimeout boo2, 0

boo2()

The problem is with this line:

newPoints = (1 for index in [0..2])

In javascript it looks like this:

// Generated by CoffeeScript 1.9.3
(function() {
  var boo, boo2;

  boo = function() {
    var index, newPoints;
    newPoints = (function() {
      var j, results;
      results = [];
      for (index = j = 0; j <= 2; index = ++j) {
        results.push(1);
      }
      return results;
    })();
    return 1;
  };

  boo2 = function() {
    var i;
    i = 1000;
    while (i -= 1 >= 0) {
      boo();
    }
    return setTimeout(boo2, 0);
  };

  boo2();

}).call(this);
@joaocgreis
Copy link
Member

@nekdolan I tested your code with the exact versions you mention above. For me, memory usage stabilizes around 500MB for the x86 version of node and 900MB for the x64. There are other issues like #25644 , where the high memory usage is misinterpreted as a memory leak. If this is not the case, can you provide more details? How much memory do you have, and if you leave it running, how long does it take to exhaust it?

Thanks for reporting!

@joaocgreis
Copy link
Member

Closing for lack of activity. We can reopen and investigate if this is still an issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants