-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Open
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: event dispatchmemory leakIssue related to a memory leakIssue related to a memory leak
Milestone
Description
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
Elements are not being garbage collected properly when the app is destroyed because they are captured inside the early event contract event info list. When calling appRef.destroy()
, we can capture the heap snapshot and observe the detached <app-root />
, which cannot be garbage collected:
Please provide a link to a minimal reproduction of the bug
https://github.com/arturovt/ng-issue-event-replay-leak
Please provide the exception or error you saw
Elements are captured in that part of the code:
const q: EventInfo[] = []; | |
const d = (eventInfo: EventInfo) => { | |
q.push(eventInfo); | |
}; | |
const h = (event: Event) => { | |
d( | |
createEventInfoFromParameters( | |
event.type, | |
event, | |
event.target as Element, | |
container, | |
Date.now(), | |
), | |
); | |
}; |
Please provide the environment you discovered this bug in (run ng version
)
Angular CLI: 19.0.4
Node: 20.11.1
Package Manager: yarn 1.22.22
OS: linux x64
Angular: 19.0.4
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router, ssr
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1900.4
@angular-devkit/build-angular 19.0.4
@angular-devkit/core 19.0.4
@angular-devkit/schematics 19.0.4
@schematics/angular 19.0.4
rxjs 7.8.1
typescript 5.6.3
zone.js 0.15.0
Anything else?
No response
jsprw
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: event dispatchmemory leakIssue related to a memory leakIssue related to a memory leak