-
Notifications
You must be signed in to change notification settings - Fork 3k
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
ObserveChanges plugin causing memory leak #4400
Comments
Hi @jeremy-smith-maco |
Yes, we have sorting in our project. We have now turned off |
Here https://handsontable.com/blog/articles/how-to-build-a-custom-version-of-handsontable is a table with dependencies. You can check which plugins are needed to run features. |
In the fiddle provided above (haven't tested our project yet) the sorting works the same with and without the |
Everything seems to be working fine in our project too. |
I have looked more into this issue. It seems that the issue is in the JSON patch library that is being used. The library does a comparison of two objects on two lines here and here which will always evaluate to false unless they are the exact same object reference used. Each time it evaluates to false in the This comparison should be changed to use a different method of object comparison. One suggestion is just to stringify both objects when comparing them (i.e. Another solution would be to manually cleanup the EDIT: Implementing my proposed solution above seems to break a lot of tests. It seems like it should be comparing object references but there still needs to be some solution for it leaking memory. At least the cause is narrowed down to the array of Mirrors which is this line. What is the point of keeping the |
Thank you for your effort, Jeremy. I am not an expert in this field but it looks like a reasonable explanation for this bug. Would it be too much to ask for a pull request? I have asked our Support developer to take a look at this issue but he will be able to do it no sooner than on 15th of Jan. |
I have added a PR with a suggested solution. Developers may have a different solution but this worked for our project at least. |
Thank you @jeremy-smith-maco |
Hey, we have run into similar issues with thousands of rows and multiple tables. |
Hello, we have found another issue with this memory leak. We have created an api using puppeteer (Puppeteer is a Node library which provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome or Chromium.) which allows end users to export their tables in different formats as png/pdf. The issue is that Chrome crashes when handsontable loads because the plugin ObserveChanges creates a big amount of listeners for huge data (above 1000 rows). It is reproducible on linux/ubuntu machines 100%. Just an FYI, if the handsontable has ObserveChanges: False, everything works fine. |
Thank you for sharing the details @dragoshzava It looks like this issue is scheduled to be fixed in April. We will test your scenario as well. |
I'm happy to see a memory leak fixed. The fix is published in the newest version 6.2.1 |
Description
Our Handsontable had a memory leak for some reason and couldn't work out why. Looking at the memory profile we noticed that the
afterLoadData
hook was being fired even though we didn't specify it in the options. We noticed it was being added by the ObserveChanges plugin but we don't have it enabled and is supposed to be disabled be default. We explicitly disabled it in our table options and fixed our memory issue. Not sure exactly what was causing it but something to do with that plugin. We added it to a jsfiddle example and it caused it to leak memory too.Steps to reproduce
observeChanges: true
to your table optionsDemo
http://jsfiddle.net/Lp4qn55v/745/
Your environment
The text was updated successfully, but these errors were encountered: