-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataTable: memory leak when data updated continuously #4656
Comments
We are also facing same issue. Pages where we use Datatable is exponentially increasing the heap size. We have signage applications which run constantly and after our release we started noticing web pages were creashing after 2-3 hours. Had to rollback everything and now after commenting out Datatable element we are noticing the heap size is normal. Can someone please take this on priority? |
Just to ask a follow up question do either of you know when this behavior started? Was it with the 9.0+ Version or has it been happening since v6 v7 v8 etc? Just trying to figure out if this is a newer bug and when it started. |
This was introduced in version 9.0 beta. |
@t-works thank you that is very helpful information. |
For us it started happening when did a prod release with npm install on July 12th. That time our package.json had: "primereact": "^9.2.0". Next day while debugging the issue we even updated t0 "primereact": "^9.6.0" and it was still happening. Now if we force 9.2.0 ("primereact": "9.2.0" in package.json) the memory leak doesnt happen.. |
@melloware Given that version 9.6 was already available at that time, this was the version installed. I can confirm that we didn't encounter this problem in version 8.7.2 or in any versions before that. I've run tests on all versions post 8.7.2 using my Minimal Reproducible Example. Based on these tests, it appears that the bug was introduced in version 9.6 but more tests are needed on our actual application to definitively confirm this. |
@ensonakamura from your reproducer it looks like the thing hogging all the memory is the System Context: in 9.6.0 a new PrimeReactProvider and PrimeReactContext was added and I have a feeling that is what is causing this new misbehavior. See: https://github.com/primefaces/primereact/blob/master/components/lib/api/PrimeReactContext.js |
Yep sorry that is correct. Our methodology was wrong. It was introduced in 9.6 |
Hi, I see 9.6.1 was released last night, can anyone please confirm if this has been fixed? |
It has not been fixed in 9.6.1 as you can see this ticket is still open. |
Setting target milestone as 10.0.3. |
Hi @ensonakamura, @gsushant, @t-works @melloware Frankly, I was confused when I read the comments. As far as I understand, this problem occurs when you update to v9.0. Can you test this and confirm? Also in v8.7.3 everything works as expected. Right? If we can determine that this issue occurs after a specific version, it will be easier to fix.
Best Regards, |
No it started in 9.6.0. If you use 9.5 it works it's in 9.6.0+ when it started. I somehow think it is PrimeReactContext related from the memory usage. |
@melloware ok;) @ensonakamura @gsushant @t-works WDYT? Do you agree with Melloware? v9.5.0 works fine for you. Right? Thanks a lot! |
Hi, After long research, I learned that this problem does not exist in 9.5.0, it came with 9.6.0. Later, when I did detailed tests, I realized that the problem was caused by the fix in the #4505 Best Regards, |
Nice work! |
Great work my man! Glad to have you back at PrimeReact! 👑 |
I had this issue after upgrading from 9.2 (to 10.1), so that'd support the 9.6 conclusion. Was having this problem in 10.1 specifically with text filtering of a single key's value. Don't know if it's just me, I'm getting hit worse now in 10.2.1 with any array over 30 documents, though reduction of array size with text filter appears to perform better. Simplistic objects in these arrays, too. useMemo'd the array, as well as alerted in console when it did change, to ensure was not changing constantly. Am I the only one feeling like something else is not right? If I can get a confirmation that others are feeling this too, I'll set time aside to investigate Bummed because I want to use passthrough but I NEED datatable e: rolling back to 9.2.3 just fixed it /e2 we're on 9.5.0 for now, thanks for identifying that @mertsincan - can confirm it is not impacted by the defect |
@chiefdeals you are saying its not an issue in 9.5.0 but still is in the latest 10.2.1 ? |
Yes |
In this example that was from the original author I see with 10.2.1 the memory stabilizing and continue to garbage collect? |
Hi @chiefdeals, sorry but I'm a little confused. Do you think datatable with filter is running slow? Or are you having a memory leak problem? |
Filtering seems irrelevant at this point, actually improves performance to get to minimal records displayed. Switching between 9.5.0 and 10.2.1 with no other changes renders an experience like a light switch, defect exists in 10.2.1, does not in 9.5.0. Unsure of root cause, but was having issues in 10.1.x too
9.5.0 meets our needs fine so we are not blocked, but if you need any insight, I will share what I can provided we get client approval first. Cheers
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: mertsincan ***@***.***>
Sent: Sunday, December 3, 2023 1:31:44 PM
To: primefaces/primereact ***@***.***>
Cc: chiefdeals ***@***.***>; Mention ***@***.***>
Subject: Re: [primefaces/primereact] DataTable: memory leak when data updated continuously (Issue #4656)
Hi @chiefdeals<https://github.com/chiefdeals>, sorry but I'm a little confused. Do you think datatable with filter is running slow? Or are you having a memory leak problem?
—
Reply to this email directly, view it on GitHub<#4656 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A6G4PMFWFDYQ4DW6OMUEVHDYHTVUBAVCNFSM6AAAAAA2KIUK36VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZXGYYDMNBRG4>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Thanks for the update! We made a lot of releases between 9.5.0 and 10.2.1, and I think we can find the solution more easily if we can find out which version your problem occurs in. Firstly, can you try your case with 9.6.0 and 9.6.4? and can you prepare a test case so we can do some tests? Maybe you can use our showcase demo for the test case. |
@chiefdeals what were your tests based on. I am trying the original issue posted in this ticket and in 10.2.1 there is no memory leak? |
I don't know if there is a memory leak, mentioned above that I do not know the root cause. My comments here are in respect to the symptoms experienced. Tests were based on my environment, as a constant, against the different versions of the package that were being discussed; where those deficits were present. Forgive me, your usage of 'tests' is a bit foreign to me. My background is not as extensive as the other contributors; recently self-taught and have not yet had a collaborative dynamic. I'm happy to assist, where I am able, but that might mean a little more "hand-holding" to get what you need from me. Apologies for that. |
@chiefdeals sorry this ticket was about a memory leak. You responded to this ticket saying you still have a leak with 10.2.1 no? What we are trying to get to the bottom of its "what is your issue?" Can you create a reproducer similar that shows how to reproduce your issue similar to: https://codesandbox.io/p/sandbox/primereact-datatable-memory-issue-forked-wcwgkt?file=%2Fsrc%2Findex.js |
Maybe, you can create a new issue for your case. In this way, it will be easier for us to follow the issue. Frankly, I think your problem is not related to memory leak. As Melloware said, a test case in the new issue would be great for us. Best Regards, |
OK we got to the bottom of it for next release:#5927 |
Apologies, fell off my radar after we downgraded. I don't have the background that you guys have. Only taught myself to code starting 18-24 mo. ago |
No worries I think we got it but let me know after the next release if your issue is no longer happening. |
I've upgraded to see, from My component hardly the same functional component as when I first experienced the issues. It's gone through several iterations and has been rebuilt twice (not tied to this issue - the old version works fine so this is not a blocker)... system based? Dont know... Not having any other weird issues |
Try 10.6.2 please |
Experiencing severe memory leaks leading to crashes in a DataTable-heavy app.
The DataTable is loaded with 20-30 columns and 50+ rows. Some of the rows data is frequently updated (every few seconds).
Minimal Reproducible Example:
Running application: https://prime-react-data-table-issue.vercel.app/
Example application code: https://codesandbox.io/s/primereact-datatable-memory-issue-xz9x6q?file=/src/App.js:631-2607
PrimeReact version
9.6.0
React version
18.x
Language
JavaScript & TypeScript
Build / Runtime
Create React App (CRA)
Steps to reproduce the behaviour
Expected behaviour
Memory consumption should not grow this rapidly and indefinitely.
The application should not crash.
The text was updated successfully, but these errors were encountered: