Skip to content
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

Resolve memory leak found by ember-cli-memory-leak-detector #118

Merged
merged 3 commits into from
Feb 1, 2023

Conversation

NullVoxPopuli
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli commented Jan 25, 2023

Locally, no errors 🎉

@changeset-bot
Copy link

changeset-bot bot commented Jan 25, 2023

🦋 Changeset detected

Latest commit: c800b76

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
ember-headless-table Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jan 25, 2023

@steveszc
Copy link

@steveszc
Copy link

I don't know enough about pnpm to understand why it could cause hung tests but I guess this is a good opportunity to learn 🙃

@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review February 1, 2023 22:44
@NullVoxPopuli NullVoxPopuli force-pushed the add-memory-leak-detection branch from 6d3c9af to dd99824 Compare February 1, 2023 22:45
@@ -10,6 +10,9 @@ module.exports = function (defaults) {
'ember-cli-babel': {
enableTypeScriptTransform: true,
},
'ember-cli-memory-leak-detector': {
enabled: process.env.DETECT_MEMORY_LEAKS || false,
Copy link
Contributor Author

@NullVoxPopuli NullVoxPopuli Feb 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is turned off by default, because of

but the way to test for memory leaks is this:
Locally,

  • build the package
  • change the test-app's reference to the package to use the file protocol, instead of workspace
  • change the test-app's qunit dependency to ~2.16.0 and ember-qunit to ^5.0.0
  • delete node_modules for the test-app
  • run yarn / npm in the test-app
  • run yarn ember test -s

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to also note that you had to change the implementation in ember-cli-memory-leak-detector to gather the classes from the addon package, since out-of-the-box it only detects classes from the host app.

Also this PR is missing the testem.js config required to run memory-leak-detector.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I had to remove everything, because there is still the hanging issue. But this is a good summary of what is needed to re-check for memory leaks (albeit, manually)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a PR that aggregates all of this: #128 for reference

@NullVoxPopuli NullVoxPopuli force-pushed the add-memory-leak-detection branch from dd99824 to c02d49d Compare February 1, 2023 22:50
@NullVoxPopuli NullVoxPopuli changed the title Add ember-cli-memory-leak-detector Resolve memory leak found by ember-cli-memory-leak-detector Feb 1, 2023
@NullVoxPopuli NullVoxPopuli merged commit 133d604 into main Feb 1, 2023
@NullVoxPopuli NullVoxPopuli deleted the add-memory-leak-detection branch February 1, 2023 23:07
@github-actions github-actions bot mentioned this pull request Feb 1, 2023
@johanrd
Copy link
Contributor

johanrd commented Apr 18, 2024

@steveszc @NullVoxPopuli I found a leak that should have been detected by ember-cli-memory-leak-detector, I think*. See #266

*most of what I've learnt about memory leaks in ember, I've learnt from you @steveszc, so please feel free to close #266 if I have misunderstood the diagnostics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants