[webkit-changes] [WebKit/WebKit] 409fc1: GCHeapInspector: Load path details for All Paths T...

Ryan Reno noreply at github.com
Sun Sep 10 09:16:00 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 409fc138ab173b3ec4deec9d47827aebaf792962
      https://github.com/WebKit/WebKit/commit/409fc138ab173b3ec4deec9d47827aebaf792962
  Author: Ryan Reno <rreno at apple.com>
  Date:   2023-09-10 (Sun, 10 Sep 2023)

  Changed paths:
    M Tools/GCHeapInspector/script/interface.js

  Log Message:
  -----------
  GCHeapInspector: Load path details for All Paths To... on demand
https://bugs.webkit.org/show_bug.cgi?id=261381
rdar://115236366

Reviewed by Simon Fraser.

GC heap nodes can easily have a huge number of paths (20k+ is not
uncommon) due to connected DOM nodes, closures, etc. When we add these
items to All Paths To... in order to inspect them in detail we create
many times more nodes in the heap inspector UI for all of the paths.
This can easily eat up tens of GB of RAM and slow the UI to a crawl.

Since most paths from roots will probably never be expanded, this change
makes it so that all of the paths from roots are shown but the full path
in the UI is created on demand only if the <details> element is toggled.
We still compute all of the paths when first adding an object to the
All Paths To... section but we store the path from a given root in a
weak map, keyed on the details element itself, to generate the path UI
if the detail is ever toggled. This also cleans up the detail DOM
subtree when toggled again to avoid growing memory unnecessarily.

* Tools/GCHeapInspector/script/interface.js:
(HeapSnapshotInspector.prototype.resetUI):
(HeapSnapshotInspector.prototype.populatePathDetailsOnDemand):
(HeapSnapshotInspector.prototype.showAllPathsToNode):
(HeapSnapshotInspector):

Canonical link: https://commits.webkit.org/267843@main




More information about the webkit-changes mailing list