Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome DevTools, Memory: what is `feedback_cell` and how to resolve memory leak that traces to it?

Testing memory leaks in Chrome DevTools (after several attach/detach the jQuery plugin) I have found that there are some delta objects but I can't understand their nature:

What is feedback_cell about which reports DevTools? I do not have such identifier in my code (here BsMultiSelect.js).

enter image description here Line number points to method definition: function staticContentGenerator(...) { I guess the feedback_cell is something from internal js structures, but I can't find anything about it.

How to deal with such traces?

like image 309
Roman Pokrovskij Avatar asked Feb 24 '20 21:02

Roman Pokrovskij


1 Answers

Got the same question, but this article helped me to understand what is feedback_cell

https://rohitwhocodes.wordpress.com/2020/08/20/feedback-vectors-in-heap-snapshots/

TLDR;

  • feedback_cell is not a cause of memory leak
  • feedback_cell (also known as feedback vector) is array of metadata information maintained by v8 engine to optimize execution performance.

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.

Update: as Sebastian said in comments

  • If you think that you don't have a memory leak, but you still see these feedback_cells, this means you do have a memory, however it is not caused by these references
like image 157
Dmitry Avatar answered Sep 20 '22 18:09

Dmitry