table icon indicating copy to clipboard operation
table copied to clipboard

Table using insane amount of memory even with virtualisation when scrolling

Open currents-jantu opened this issue 1 year ago • 2 comments

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

  • [X] I agree to follow this project's Code of Conduct
  • [X] I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

currents-jantu avatar Aug 06 '24 06:08 currents-jantu

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.

songchengen avatar Aug 06 '24 09:08 songchengen

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.

currents-jantu avatar Aug 07 '24 06:08 currents-jantu