In my Angular app, I am looking for memory leaks and found that when in a snapshot of the memory heap I can see 3 of every service, as well as 3 AppModules, AppRouterModules and AppComponents:
Just wondering if this is this normal, or am I triple binding somewhere? And where would I look for that.
Consider these points:
The count does not increase as I navigate around or interact with the app.
The count is 3 immediately after a fresh reload, if I stick a breakpoint in the ngOnInit() method - i.e. no other component has yet loaded.
The count remains 3 even after clearing console, and requesting garbage collection.
AppComponent is only referenced by AppModule in the declarations, and bootstrap properties once in my code.
AppModule is only referenced in main.ts like this:
platformBrowserDynamic().bootstrapModule(AppModule);
I'm using lazy loading
I'm running Angular 13
The count remains at 3 even when I run enableProdMode() before bootstrap