You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Memory leak in freshly generated Ember 3.28.8 app #20032
With a newly generated app with only one newly generated component, Ember Container is leaked after test run.
If you keeps executing test runs your memory keeps getting bigger and bigger.
@ctjhoa I cannot reproduce the Container and doble Registry in your repro. Are you still able to?
I cloned the reproduction repo and ran pnpm run test:ember --serve, taking heap snapshots after 1, 2, 10, and 20 reloads. The heap grows ~0.55 MB per reload and never stabilizes:
Snapshot
Heap self-size
After 1st load
13.0 MB
After 2nd load
13.6 MB
After 10 reloads
18.7 MB
After 20 reloads
23.8 MB
However, the Ember Container and Registry are not the leaking objects (at least not in my reproduction). Registry stays at 1 instance and Container doesn't appear as retained.
The actual leak is V8 compiled script contexts that are never garbage collected between test reloads. A programmatic diff of the heap snapshots shows:
V8 internal
Count at snap 1
Count at snap 20
Size leaked
(script line ends)
13
132
9.4 MB
Vendor bundle string (re-parsed copy)
2
28
419 KB
BytecodeArray
2,351
3,363
165 KB
ScopeInfo
2,513
3,934
124 KB
(shared function info)
1,326
2,077
36 KB
Each reload re-evaluates all <script> tags (vendor.js, test-support.js, testem.js, socket.io) but old V8 compilation contexts are never freed. The script URL entries themselves grow linearly
(e.g., http://localhost:7357/assets/vendor.js goes from 1 → 22 instances, one per reload). QUnit/test-helper functions (pauseTest, resumeTest, setupContext, teardownContext) also accumulate ~1
copy per reload.
To me, this points to a test harness (testem) script reload issue rather than an Ember framework leak.
Activity
chriskrycho commentedon Mar 18, 2022
Thank you for reporting this! I've tagged it and hopefully someone will have a chance to poke at it sometime soon!
pichfl commentedon May 17, 2022
Difficult to say precisely, but we might be running into similar issues in our project.
mountHouli commentedon Jan 17, 2024
Hi Ember folks!
I'm using Hashicorp Vault. It uses Ember. My security team has flagged this issue and I am required to address it.
Does this bug still exist in Ember? Does it exist in Ember 4.x.x? Does it exist in Ember 5.x.x?
Thanks!
johanrd commentedon Feb 20, 2026
@ctjhoa I cannot reproduce the Container and doble Registry in your repro. Are you still able to?
I cloned the reproduction repo and ran
pnpm run test:ember --serve, taking heap snapshots after 1, 2, 10, and 20 reloads. The heap grows ~0.55 MB per reload and never stabilizes:However, the Ember
ContainerandRegistryare not the leaking objects (at least not in my reproduction).Registrystays at 1 instance andContainerdoesn't appear as retained.The actual leak is V8 compiled script contexts that are never garbage collected between test reloads. A programmatic diff of the heap snapshots shows:
(script line ends)BytecodeArrayScopeInfo(shared function info)Each reload re-evaluates all
<script>tags (vendor.js,test-support.js,testem.js,socket.io) but old V8 compilation contexts are never freed. The script URL entries themselves grow linearly(e.g.,
http://localhost:7357/assets/vendor.jsgoes from 1 → 22 instances, one per reload). QUnit/test-helper functions (pauseTest,resumeTest,setupContext,teardownContext) also accumulate ~1copy per reload.
To me, this points to a test harness (testem) script reload issue rather than an Ember framework leak.
kategengler commentedon Jun 23, 2026
cc @NullVoxPopuli Do you think we should close this?
NullVoxPopuli commentedon Jun 23, 2026
aye