Application stays in memory even after being destroyed #22106
Labels
area: core
Issues related to the framework runtime
core: bootstrap
core: performance
freq3: high
memory leak
Issue related to a memory leak
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
state: confirmed
type: bug/fix
Milestone
Uh oh!
There was an error while loading. Please reload this page.
I'm submitting a...
Current behavior
When the platform is destroyed, the DOM node is removed but the application still exists in memory. This is easily verified by taking a heap snapshot after destruction of the platform.
Expected behavior
When the application is destroyed using PlatformRef.destroy() or even if the DOM node was removed manually, the application should not continue to exist in memory.
Minimal reproduction of the problem with instructions
Here is a simple stackblitz application that illustrates the problem: https://angular-h1zvzr.stackblitz.io/
What is the motivation / use case for changing the behavior?
In a portal environment where applications may come and go as the user navigates around, this causes a significant memory leak when the applications are not cleaned up.
Environment
This is related to #13725 but that defect seems to have conflated several different things into one conversation.
The text was updated successfully, but these errors were encountered: