CrowdStrike / ember-headless-table

https://ember-headless-table.pages.dev
MIT License
23 stars 7 forks source link

Memory leak: `Table`, `TableMeta` and `TableProperty` classes are retained in memory after destruction when using table/column modifiers or `column.getValueForRow` #266

Closed johanrd closed 5 months ago

johanrd commented 5 months ago
  1. Clone this repo and run the docs app
  2. Enter the index route and see that there is one instance of the Table class is retained in Heap memory. This is expected.
  3. Exit the route and enter /testing (a route without a rendered table), then re-enter the index route. Now, see that the Table class retained in memory twice.
  4. Repeat exiting and entering the same routes, and see that for each exit of the index route, new instances of the Table class are retained in memory:

https://github.com/CrowdStrike/ember-headless-table/assets/4601554/40983c64-d87a-4bd3-944c-ef21054057e4

This is also reproducible in my own webapp whenever I use a table or column modifier, or use the column.getValueForRow helper.

Removing all the modifiers and {{column.getValueForRow row}} from demo-a.md resolves the issue, so this is most likely caused by columns not being teared down correctly.

NullVoxPopuli commented 5 months ago

there has been a memory leak in glimmer-vm around locally defined helpers and modifiers prior to ember-source 5.6 -- I believe if the docs app upgrades to ember-source 5.6+ the memory leak would be resolved

More info here:

johanrd commented 5 months ago

@NullVoxPopuli Thanks!

I can verify that this is not reproducible if I run the docs-app with ember-source@5.8.0😌