-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Application stays in memory even after being destroyed #22106
Copy link
Copy link
Closed
RatkoR/angular
#1Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimeIssues related to the framework runtimecore: bootstrapcore: performancefreq3: highmemory leakIssue related to a memory leakIssue related to a memory leakstate: confirmedtype: bug/fix
Milestone
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimeIssues related to the framework runtimecore: bootstrapcore: performancefreq3: highmemory leakIssue related to a memory leakIssue related to a memory leakstate: confirmedtype: bug/fix
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.