PERF: There seems to be a memory leakage in frontend-store

Reproduce steps is like the following: user skips from one topic to another using the “suggested/related” under the topic for multiple times without refreshing the page, and the js heap size will accumulate from the original 100MB to about 500MB in my test, if visited topics are enough(especially for topics with much posts under it). And returning to the homepage won’t release that part of occupied memory.

This js heap size can be seen from the browser console-performance, and the memory consumption can be seen from the process manager of the browser.

I uploaded a video of this attached in the PR, just showcase the problem(about 3 mins, when using the same page for more hours, the situation will be worse)

And also adding a breakpoint here will showcase the growing amount of items in _identityMap

But I’m not quite sure if _identityMap is the root cause of this issue, just provide some info for investigation.

2 Likes