javascript - Chrome DevTools,内存 : what is `feedback_cell` and how to resolve memory leak that traces to it?

标签 javascript jquery google-chrome-devtools

在 Chrome DevTools 中测试内存泄漏(在几次附加/分离 jQuery 插件之后)我发现有一些 delta 对象,但我无法理解它们的性质:

什么是feedback_cell关于哪些报告 DevTools?我的代码中没有这样的标识符(这里是 BsMultiSelect.js)。

enter image description here
行号指向方法定义:function staticContentGenerator(...) {我猜 feedback_cell是来自内部 js 结构的东西,但我找不到任何关于它的东西。

如何处理这样的痕迹?

最佳答案

有同样的问题,但是这篇文章帮助我理解了什么是feedback_cell
https://rohitwhocodes.wordpress.com/2020/08/20/feedback-vectors-in-heap-snapshots/
TLDR;

  • feedback_cell 不是内存泄漏的原因
  • feedback_cell(也称为反馈向量)是由 v8 引擎维护的元数据信息数组,用于优化执行性能。

  • How do feedback vectors affect memory investigations?

    They are a red herring and if you see a feedback_cell in the retainer list that you are investigating, you can safely assume this specific retainer list is not the cause of the leak.

    You can think of feedback vectors are soft references and hence it is safe to ignore them as a cause of a memory leak.


    更新 :正如塞巴斯蒂安在评论中所说
  • 如果你认为你没有内存泄漏,但你仍然看到这些feedback_cells,这意味着你确实有内存,但这不是由这些引用引起的
  • 关于javascript - Chrome DevTools,内存 : what is `feedback_cell` and how to resolve memory leak that traces to it?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60384491/

    相关文章:

    javascript - JQuery 更改类不起作用

    javascript - 努力使用 .querySelector 查询具有相同类名的特定元素

    java - Selenium webdriver-获取性能日志-未知日期时间戳(12345.12345)

    jquery - 如何使用 jQuery 显示阅读更多链接后的内容?

    javascript - jQuery垂直滑动动画不动

    javascript - 客户端可以链接到托管在不同域上的我的 JavaScript 吗?

    javascript - jQuery 每次迭代中未定义的元素

    google-chrome - Chrome 开发者工具 "disable cache": what does it actually do apart from nothing (for service worker scripts)?

    javascript - 提交表单后如何在屏幕上保留模式/ toast ?

    javascript 如何将数字 1.0 转换为字符串 "1.0"?