Skip to content

Cyclic references leak memory #138

@DirtyHairy

Description

@DirtyHairy
var foo;

while (true) {
   var x = {};
   var y = {x: x, a: []};
   x.y = y;

   foo = x;

   for (var i = 0; i < 1000000; i++) y.a[i] = i;
}

console.log(foo);

Open top and watch it gobble memory.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions