[Bug] Memory Leak of routeRecognizer states in acceptance tests
- Dominant language
- TypeScript
- Stars
- 22.6k
- Forks
- 4.2k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 15
Description
### 🐞 Describe the Bug
In acceptance tests on ember 3.24 (and latest), routeRecognizer instances are being retained by EmberRouter: (Heap snapshot from super rentals tests, of the states from routeRecognizer being retained)

Once an instance of the routeRecognizer is retained, the number of State in the states array adds up quickly in large apps, causing the browser to crash due to OOM. (In our large ember app, a single routeRecognizer instance stores ~60,000 states)
### 🔬 Minimal Reproduction
Running an app using ember 3.24+, create an acceptance test.
Using Chrome's Memory tab, run the test and capture a heap dump
Inspect the heap dump for 'State' constructors, notice instances of routeRecognizer class
### 😕 Actual Behavior
_routerMicrolib is hanging on to references states from routeRecognizer.
### 🤔 Expected Behavior
References to routeRecognizer should be cleaned up in between tests.
### 🌍 Environment
Ember: 3.24.4 or higher
Node.js/npm: v14.15.1
OS: Mac
Browser: Chrome
### ➕ Additional Context
N/A
Contributor guide
Assessment
This issue has not been assessed yet.