New issue
Advanced search Search tips

Issue 767553 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 765666
Owner:
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Heap snapshot is missing some objects

Project Member Reported by alph@chromium.org, Sep 21 2017

Issue description

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

A quick investigation showed that we consider MyClass objects are internal as they are not reachable from the global object. The only strong reference is the execution stack.

Solutions could be:
a) introduce a stack entity whose references will be treated as user objects.
b) whitelist debugger objects and treat all objects not dominated by the debugger as user.

Comment 2 by alph@chromium.org, Oct 20 2017

Mergedinto: 765666
Status: Duplicate (was: Assigned)

Sign in to add a comment