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

fix: fix Compiler not getting freed after use #8268

Merged
merged 4 commits into from
Nov 12, 2024
Merged

fix: fix Compiler not getting freed after use #8268

merged 4 commits into from
Nov 12, 2024

Conversation

h-a-n-a
Copy link
Collaborator

@h-a-n-a h-a-n-a commented Oct 30, 2024

Summary

closes #3169

Fixed an issue when constantly creating compilers and the memory is not getting freed after use.

This issue was fixed with WeakRef and function expression which does not capture this, which is Compiler in this case. But still, I'm not able to create a MRE with both minimal Rust and JS code. So this issue might be appropriately tackled once a MRE is created.

Tests will be added in up-coming PRs. We might need to take https://github.com/napi-rs/napi-rs/tree/main/memory-testing as a reference.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Oct 30, 2024
Copy link

netlify bot commented Oct 30, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit dd57bc3
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/6732d029f520a20008b2756c

@h-a-n-a
Copy link
Collaborator Author

h-a-n-a commented Oct 31, 2024

Release Canary
Version: 1.0.15-canary-cc53546f-20241030081506

@h-a-n-a h-a-n-a force-pushed the memory-leak branch 3 times, most recently from 15d1368 to e314c9b Compare November 7, 2024 06:53
@h-a-n-a h-a-n-a marked this pull request as ready for review November 12, 2024 05:35
@h-a-n-a h-a-n-a changed the title fix: memory leak in JavaScript Compiler fix: fix Compiler not getting freed after use Nov 12, 2024
@h-a-n-a h-a-n-a merged commit 8f75992 into main Nov 12, 2024
38 checks passed
@h-a-n-a h-a-n-a deleted the memory-leak branch November 12, 2024 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory leak when using @rspack/core API
2 participants