If an object is retained by a strong global handle, it is difficult to see what component created the global handle. We could provide a string description for each strong global handle and then show that in heap snapshot.
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/bba08b33145952466ebd4b205bfa63ccffd5623f commit bba08b33145952466ebd4b205bfa63ccffd5623f Author: Ulan Degenbaev <ulan@chromium.org> Date: Wed Feb 14 10:17:34 2018 [heap] Add description parameter to RootVisitor methods. The description will be used to annotate roots in the heap snapshot. Bug: chromium:811842 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng Change-Id: Ic5c9a89d1921cabddb06783f08ba63740e72820d Reviewed-on: https://chromium-review.googlesource.com/916564 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#51286} [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/api-arguments.h [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/api.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/bootstrapper.h [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/builtins/builtins-api.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/builtins/builtins.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/compilation-cache.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/debug/debug.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/frames.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/global-handles.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/heap/heap.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/heap/heap.h [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/heap/incremental-marking.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/heap/mark-compact.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/heap/scavenger.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/heap/scavenger.h [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/interpreter/interpreter.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/isolate.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/profiler/heap-snapshot-generator.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/snapshot/builtin-deserializer.h [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/snapshot/builtin-serializer.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/snapshot/builtin-serializer.h [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/snapshot/code-serializer.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/snapshot/deserializer.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/snapshot/deserializer.h [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/snapshot/object-deserializer.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/snapshot/partial-deserializer.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/snapshot/partial-serializer.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/snapshot/serializer-common.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/snapshot/serializer.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/snapshot/serializer.h [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/snapshot/startup-serializer.cc [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/snapshot/startup-serializer.h [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/src/visitors.h [modify] https://crrev.com/bba08b33145952466ebd4b205bfa63ccffd5623f/test/cctest/heap/test-heap.cc
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/7e6d62852da585c09361cbe9f7667a26bba5acb9 commit 7e6d62852da585c09361cbe9f7667a26bba5acb9 Author: Ulan Degenbaev <ulan@chromium.org> Date: Mon Feb 19 10:03:38 2018 [heap-profiler] Simplify snapshotting of the roots. This replaces three passes over the roots with a single pass. This also removes root synchronization logic. The GC subroot index is computed from the |root| parameter of the visit method. The new |description| parameter is used as an edge name. Bug: chromium:811842 Change-Id: I03a9215d56b54b3eb5f7bc8b32d5b22ad091c68b Reviewed-on: https://chromium-review.googlesource.com/916781 Reviewed-by: Alexei Filippov <alph@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#51350} [modify] https://crrev.com/7e6d62852da585c09361cbe9f7667a26bba5acb9/src/builtins/builtins.cc [modify] https://crrev.com/7e6d62852da585c09361cbe9f7667a26bba5acb9/src/global-handles.cc [modify] https://crrev.com/7e6d62852da585c09361cbe9f7667a26bba5acb9/src/global-handles.h [modify] https://crrev.com/7e6d62852da585c09361cbe9f7667a26bba5acb9/src/heap/heap.cc [modify] https://crrev.com/7e6d62852da585c09361cbe9f7667a26bba5acb9/src/heap/heap.h [modify] https://crrev.com/7e6d62852da585c09361cbe9f7667a26bba5acb9/src/profiler/heap-snapshot-generator.cc [modify] https://crrev.com/7e6d62852da585c09361cbe9f7667a26bba5acb9/src/profiler/heap-snapshot-generator.h [modify] https://crrev.com/7e6d62852da585c09361cbe9f7667a26bba5acb9/src/visitors.cc [modify] https://crrev.com/7e6d62852da585c09361cbe9f7667a26bba5acb9/src/visitors.h
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/466d157cb7f947763126798a374a533f535b35f8 commit 466d157cb7f947763126798a374a533f535b35f8 Author: Ulan Degenbaev <ulan@chromium.org> Date: Mon Feb 19 11:42:03 2018 [api] Add API for annotating retainer of a strong global handle. This adds PersistentBase::AnnotateStrongRetainer(const char*) function. The annotation is used by the heap snapshot generator to show the edges from the (Global handles) root to the global handles. Bug: chromium:811842 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng Change-Id: I1a9e3e53a53aeaf2b590709fab8dd4ecf7e8f252 Reviewed-on: https://chromium-review.googlesource.com/916788 Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Reviewed-by: Alexei Filippov <alph@chromium.org> Cr-Commit-Position: refs/heads/master@{#51358} [modify] https://crrev.com/466d157cb7f947763126798a374a533f535b35f8/include/v8.h [modify] https://crrev.com/466d157cb7f947763126798a374a533f535b35f8/src/api.cc [modify] https://crrev.com/466d157cb7f947763126798a374a533f535b35f8/src/global-handles.cc [modify] https://crrev.com/466d157cb7f947763126798a374a533f535b35f8/src/global-handles.h [modify] https://crrev.com/466d157cb7f947763126798a374a533f535b35f8/test/cctest/test-heap-profiler.cc
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/4a90e48689a80a229c8506ce017084efe899ca0b commit 4a90e48689a80a229c8506ce017084efe899ca0b Author: Ulan Degenbaev <ulan@chromium.org> Date: Mon Feb 19 12:21:52 2018 [heap-profiler] Annotate global handles retained by console and debugger. Bug: chromium:811842 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel Change-Id: I72163abf0b20b123fb541fe0a1b168e036ef044e Reviewed-on: https://chromium-review.googlesource.com/919063 Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Reviewed-by: Alexei Filippov <alph@chromium.org> Cr-Commit-Position: refs/heads/master@{#51360} [modify] https://crrev.com/4a90e48689a80a229c8506ce017084efe899ca0b/src/inspector/injected-script.cc [modify] https://crrev.com/4a90e48689a80a229c8506ce017084efe899ca0b/src/inspector/v8-console-message.cc [modify] https://crrev.com/4a90e48689a80a229c8506ce017084efe899ca0b/src/inspector/v8-debugger-script.cc [add] https://crrev.com/4a90e48689a80a229c8506ce017084efe899ca0b/test/inspector/heap-profiler/console-retaining-path-expected.txt [add] https://crrev.com/4a90e48689a80a229c8506ce017084efe899ca0b/test/inspector/heap-profiler/console-retaining-path.js
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/b3bf446ed26ea64b14cf4d403627bd43d0c550a6 commit b3bf446ed26ea64b14cf4d403627bd43d0c550a6 Author: Mostyn Bramley-Moore <mostynb@vewd.com> Date: Tue Feb 20 07:33:41 2018 [jumbo] fix kGlobalHandleLabel redefinition Followup after https://chromium-review.googlesource.com/c/v8/v8/+/919063 Bug: chromium:811842 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel Change-Id: I8e8a4a6d9192d39502514c5a19539965b74b1681 Reviewed-on: https://chromium-review.googlesource.com/925603 Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Commit-Queue: Mostyn Bramley-Moore <mostynb@vewd.com> Cr-Commit-Position: refs/heads/master@{#51383} [modify] https://crrev.com/b3bf446ed26ea64b14cf4d403627bd43d0c550a6/src/inspector/v8-console-message.cc [modify] https://crrev.com/b3bf446ed26ea64b14cf4d403627bd43d0c550a6/src/inspector/v8-debugger-script.cc
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/a07b245e010d69d6f4f362663852d9c34f32c472 commit a07b245e010d69d6f4f362663852d9c34f32c472 Author: Michael Lippautz <mlippautz@chromium.org> Date: Wed Mar 14 19:49:03 2018 [heap-profiler] Annotate global handle Annotate global handle with label to identify the context held alive for debugging in DevTools Bug: chromium:811842 Change-Id: I24f08b4d01939421ba1b7ec7b03982f00ebbdd1a Reviewed-on: https://chromium-review.googlesource.com/962788 Reviewed-by: Yang Guo <yangguo@chromium.org> Commit-Queue: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/master@{#51936} [modify] https://crrev.com/a07b245e010d69d6f4f362663852d9c34f32c472/src/debug/debug.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1ab087d88398ada0c6daf615e8306e5b29d684c2 commit 1ab087d88398ada0c6daf615e8306e5b29d684c2 Author: Michael Lippautz <mlippautz@chromium.org> Date: Fri Mar 16 13:43:39 2018 [heap-profiler] Annotate global handles With these annotations the corresponding global handles now have names in DevTools, making it easy to identify where a context is held alive. Bug: chromium:811842 Change-Id: I10df68d3024a07744e7f18a27f7c07700545a803 Reviewed-on: https://chromium-review.googlesource.com/962789 Reviewed-by: Jochen Eisinger <jochen@chromium.org> Commit-Queue: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/master@{#543684} [modify] https://crrev.com/1ab087d88398ada0c6daf615e8306e5b29d684c2/extensions/renderer/script_context.cc [modify] https://crrev.com/1ab087d88398ada0c6daf615e8306e5b29d684c2/gin/context_holder.cc [modify] https://crrev.com/1ab087d88398ada0c6daf615e8306e5b29d684c2/third_party/WebKit/Source/platform/bindings/ScriptState.h [modify] https://crrev.com/1ab087d88398ada0c6daf615e8306e5b29d684c2/third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp
Assuming this was fixed.
Comment 1 by u...@chromium.org
, Feb 13 2018