There seems to be a memory leakage in store.js file, when users browses through different topics, the _identityMap seems to be growing rapidly with each restful request. Without a proper cleanup logic, the map will exhaust memory with large js heaps.
Maybe adding a pruneMap function to the store.js, with FIFO algorithm to remove the earliest maps will be enough?
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