DevTools: live WeakMap values are missing from heap snapshot. |
|||
Issue descriptionThe attached html file adds many (Key, Value) items into the global weak_map. The keys are retained separately in a global keys array. Since keys are alive, all values are also alive (due to ephemeron semantics of WeakMaps). You can see it from the size of the heap (700MB). However, heap snapshot does not show any Value object. Console log of DevTools has warnings like "Heap snapshot: 3034 nodes are unreachable from the root. Following nodes have only weak retainers: onload @3485 weak retainers: (Global handles)@29.205 Value @7165 weak retainers: @51345.2266 Value @7181 weak retainers: @51345.3228 Value @7189 weak retainers: @51345.1822 Value @7197 weak retainers: @51345.1490 Value @7205 weak retainers: @51345.788 ..." The heap snapshot generator treats WeakMap values as simple weak references, which is incorrect. The (key, value) pairs in WeakMaps should be treated as ephemerons.
,
Oct 23 2017
a related issue https://bugs.chromium.org/p/v8/issues/detail?id=6987
,
Feb 13 2018
,
Feb 26 2018
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/e8925ad5096720435a24cced75da5143d846de8e commit e8925ad5096720435a24cced75da5143d846de8e Author: Ulan Degenbaev <ulan@chromium.org> Date: Mon Feb 26 11:35:45 2018 [heap-profiler] Show key as the value retainer for weak maps. The key -> value edge is shown as "<index> / WeakMap", where <index> is the index of the edge in the key. Bug: chromium:778739 , chromium:749502 Change-Id: I657051695f2a171372788dbb777543a55a35d554 Reviewed-on: https://chromium-review.googlesource.com/926524 Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Reviewed-by: Alexei Filippov <alph@chromium.org> Cr-Commit-Position: refs/heads/master@{#51559} [modify] https://crrev.com/e8925ad5096720435a24cced75da5143d846de8e/src/profiler/heap-snapshot-generator.cc [modify] https://crrev.com/e8925ad5096720435a24cced75da5143d846de8e/test/cctest/test-heap-profiler.cc
,
Feb 26 2018
|
|||
►
Sign in to add a comment |
|||
Comment 1 by mlippautz@chromium.org
, Oct 20 2017