gpt4 book ai didi

profiling - Chrome Heap Profiler 中分离的 DOM 节点的颜色是什么意思?

转载 作者:行者123 更新时间:2023-12-03 23:36:29 26 4
gpt4 key购买 nike

在使用 Chrome devtools 分析堆快照时,我似乎无法弄清楚查看分离的 DOM 树时颜色的含义。红色和黄色有什么区别?

enter image description here

最佳答案

有很好的解释available here .

从文章:

Red nodes do not have direct references from JavaScript to them, but are alive because they’re part of a detached DOM tree. There may be a node in the tree referenced from JavaScript (maybe as a closure or variable) but is coincidentally preventing the entire DOM tree from being garbage collected.

Yellow nodes however do have direct references from JavaScript. Look for yellow nodes in the same detached DOM tree to locate references from your JavaScript. There should be a chain of properties leading from the DOM window to the element (e.g window.foo.bar[2].baz).

关于profiling - Chrome Heap Profiler 中分离的 DOM 节点的颜色是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13371119/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com