You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I believe I've found a memory leak related to react-virtual. I've only confirmed it occurs in combination with react-table at this point, but it may be unrelated to that project.
Steps to reproduce
I used the following table component in the screenshots below.
On mount, with the table scrolled to the top, memory consumption of my page is ~10MB.
After scrolling the table to the bottom using the mouse wheel (to make sure each row is scrolled into view and rendered at least once), the pages memory consumption jumped to 143MB. Note that there are 2000 rows in the table.
Following the three snapshot technique (mentioned here), I noticed that there were a bunch of extra FiberNodes and Detached HTMLDivElements still on the heap.
These appear to be old row div elements that never get properly cleaned up.
Many of the extra objects created appear to be React props.
I'm no expert on React internals or reading JS heap dumps, but this looks somewhat similar to this issue. If so, the problem may well lie upstream in React. But I will note that I don't have this problem when using react-window, so maybe there's something special that it does to avoid this?
Environment
react-virtual: 2.8.1
react-table: 7.1.0
react: 17.0.1
Google Chrome: Version 92.0.4515.107 (Official Build) (64-bit)
The text was updated successfully, but these errors were encountered:
Ooo good catch 👍 Manage to reproduce it, happens in react developer tools in context of hooks, also in production build. I think you didn't observe it with react-window because it's build using class components.
Trying to pin point where it leaks, for now disable the developer tools.
Hi, I believe I've found a memory leak related to react-virtual. I've only confirmed it occurs in combination with react-table at this point, but it may be unrelated to that project.
Steps to reproduce
I used the following table component in the screenshots below.
Table code
On mount, with the table scrolled to the top, memory consumption of my page is ~10MB.
After scrolling the table to the bottom using the mouse wheel (to make sure each row is scrolled into view and rendered at least once), the pages memory consumption jumped to 143MB. Note that there are 2000 rows in the table.
Following the three snapshot technique (mentioned here), I noticed that there were a bunch of extra
FiberNode
s andDetached HTMLDivElement
s still on the heap.These appear to be old row div elements that never get properly cleaned up.
Many of the extra objects created appear to be React props.
I'm no expert on React internals or reading JS heap dumps, but this looks somewhat similar to this issue. If so, the problem may well lie upstream in React. But I will note that I don't have this problem when using react-window, so maybe there's something special that it does to avoid this?
Environment
react-virtual: 2.8.1
react-table: 7.1.0
react: 17.0.1
Google Chrome: Version 92.0.4515.107 (Official Build) (64-bit)
The text was updated successfully, but these errors were encountered: