[Webkit-unassigned] [Bug 163151] Web Inspector: Heap Snapshot should be able to tell me if an object was collected

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 12 12:16:50 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=163151

--- Comment #11 from Joseph Pecoraro <joepeck at webkit.org> ---
(In reply to comment #10)
> > "Snapshot" is
> > accurate with respect to the references / relationships between objects.
> > That relationship graph doesn't change, only our view of the objects inside
> > it.
> 
> Are you saying that snapshots do not update as objects gain and lose
> properties? I believe they do.

Nope. Again, snapshots only gather data about the relationships (strong references) between objects. Snapshots do not save the state / values of objects (it totally skips over primitives).

When you _view_ a Snapshot in Web Inspector we display the live instance, not the state of the object when it was snapshotted, because we didn't gather that information. If we were to to serialize a snapshot of every object when the snapshot was taken that would be quite a lot of data, especially when for detecting leaks the object is still alive, so having the capability of interacting with the live leaked object is more useful.

> In this example:
> 
> var o = { A, B }; // snapshot 0
> delete o.A // snapshot 1
> 
> Do snapshot 0 and snapshot 1 agree on the properties of o, or does snapshot
> 0 show { A, B } while snapshot 1 shows { B }?

This depends on what you mean.

When Viewing Snapshot 0:

    - There is an Object `o`
      - The Live display shows { B }
      - Expanding the Object in the snapshot shows properties "A" and "B" holding onto objects|strings `A` and `B`
        - There is a Live display of B
        - A may be collected so we show that the object was collected
          - You can even get information about how A was kept alive (in this case, via o)

When Viewing Snapshot 1:

    - There is an Object `o`
      - The Live display shows { B }
      - Expanding the Object in the snapshot shows one property "B" holding onto an objects|string `B`
        - There is a Live display of B

So yes, the individual display of `o` shows the live value, but expanding the Snapshot Object Graph shows the Relationships that existed when the Snapshot was taken.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20161012/a52a08cd/attachment-0001.html>


More information about the webkit-unassigned mailing list