TanStack / table

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table
https://tanstack.com/table
MIT License
25.16k stars 3.07k forks source link

Table using insane amount of memory even with virtualisation when scrolling #5696

Open currents-jantu opened 2 months ago

currents-jantu commented 2 months ago

TanStack Table version

8.10.0

Framework/Library version

18.2.0

Describe the bug and the steps to reproduce it

Table using more than 2gbs of memory when scrolling with (2000*2000) virtualized row columns. It's seems to be memoization causing this.

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://codesandbox.io/p/devbox/clever-leftpad-d4vwhh

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

No, because I do not know how

Terms & Code of Conduct

songchengen commented 2 months ago

You might want to take a look at this.

https://tanstack.com/table/latest/docs/faq#pitfall-1-creating-new-columns-or-data-on-every-render

Just move tableData outside the component and it will be fine.

currents-jantu commented 2 months ago

You might want to take a look at this.

https://tanstack.com/table/latest/docs/faq#pitfall-1-creating-new-columns-or-data-on-every-render

Just move tableData outside the component and it will be fine.

Thanks for the help. I have converted the tableData variable to a state, but the issue still persists. Updated the sandbox also.