1. Run the following snippet in devtools.
2. When it stops on the breakpoint take a heap snapshot
3. My class objects are missing from the list as well as the arrays.
var foo = function() {
var MyClass = function(i) {
this.num = i;
this.z = new Array(10000).fill(5);
}
MyClass.prototype.speak = function() { console.log("I have spoken" + this.num); }
var objects = [];
for(var i = 0; i < 1000; i++) {
objects.push(new MyClass(i));
}
debugger;
for(var i = 0; i < objects.length; i++) {
objects[i].speak();
}
}
foo();
Comment 1 by alph@chromium.org
, Sep 21 2017