New issue
Advanced search Search tips

Issue 815263 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

DevTools: queryObjects(Array) should not grow forever

Project Member Reported by l...@chromium.org, Feb 23 2018

Issue description

What steps will reproduce the problem?
(1) Repeatedly evaluate 'queryObjects(Array)' in the DevTools console
(2) Observe the size of the array
(3) Clear the console
(4) Observe the size of the array

What is the expected result?
The size should reset after clearing the console.
Users may also benefit from another 'info/note' icon next to the queryObjects result saying that "A new Array has been allocated for this result" to avoid surprise.

What happens instead?
The result of queryObjects is an Array itself, which has a reference that doesn't get cleared upon console.clear.
 

Comment 1 by l...@chromium.org, Feb 28 2018

Cc: kozy@chromium.org
kozy@, there seem to be a couple ways to address this.  We're not sure which is best.
- Adding "console" objectGroupName to all inspect-type results. [0]  However, the frontend already manually releases the result in cases like [1]
- Manually free queryObjects results on the frontend [2].  Tracking objects is what objectGroupNames are intended for, however.
- maybe we should tag inspect-results with a new "inspect" objectGroup, and release that in frontend?

[0] https://chromium-review.googlesource.com/c/v8/v8/+/935153
[1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js?l=334
[2] https://chromium-review.googlesource.com/c/chromium/src/+/935752

wdyt about these options?
Project Member

Comment 2 by bugdroid1@chromium.org, Mar 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/d452a7f63a41cff3e48f0d6b83238fd798fc28da

commit d452a7f63a41cff3e48f0d6b83238fd798fc28da
Author: Erik Luo <luoe@chromium.org>
Date: Wed Mar 14 20:12:56 2018

[inspector] queryObjects() should take objectGroup

Now, 'queryObjects' takes an optional 'objectGroup' argument,
allowing the frontend to release the response value.

This is important because each call produces a new Array, which
could not be released before.

Bug:  chromium:815263 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I18c9a68c4ba45020fce9eea63cb263396a18d498
Reviewed-on: https://chromium-review.googlesource.com/935153
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51938}
[modify] https://crrev.com/d452a7f63a41cff3e48f0d6b83238fd798fc28da/src/inspector/js_protocol.json
[modify] https://crrev.com/d452a7f63a41cff3e48f0d6b83238fd798fc28da/src/inspector/js_protocol.pdl
[modify] https://crrev.com/d452a7f63a41cff3e48f0d6b83238fd798fc28da/src/inspector/v8-runtime-agent-impl.cc
[modify] https://crrev.com/d452a7f63a41cff3e48f0d6b83238fd798fc28da/src/inspector/v8-runtime-agent-impl.h
[modify] https://crrev.com/d452a7f63a41cff3e48f0d6b83238fd798fc28da/test/inspector/protocol-test.js
[modify] https://crrev.com/d452a7f63a41cff3e48f0d6b83238fd798fc28da/test/inspector/runtime/query-objects-expected.txt
[modify] https://crrev.com/d452a7f63a41cff3e48f0d6b83238fd798fc28da/test/inspector/runtime/query-objects.js

Project Member

Comment 3 by bugdroid1@chromium.org, Mar 14 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3e55967faae330715ffceaf984e8cac636334a72

commit 3e55967faae330715ffceaf984e8cac636334a72
Author: Erik Luo <luoe@chromium.org>
Date: Wed Mar 14 22:03:08 2018

DevTools: show specific note for queryObjects result

This modifies the 'i' note next to the queryObjects result array to
describe how objects may not be collected if they are previewed until
console.clear

Screenshot: https://imgur.com/a/q03rG

Bug:  815263 
Change-Id: I872ca733fd4b3ae3f64487e6c969167c26119c62
Reviewed-on: https://chromium-review.googlesource.com/961556
Commit-Queue: Erik Luo <luoe@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543215}
[modify] https://crrev.com/3e55967faae330715ffceaf984e8cac636334a72/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
[modify] https://crrev.com/3e55967faae330715ffceaf984e8cac636334a72/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js
[modify] https://crrev.com/3e55967faae330715ffceaf984e8cac636334a72/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js

Comment 4 by l...@chromium.org, Mar 14 2018

Status: Fixed (was: Assigned)

Sign in to add a comment