Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

290
Vistas
Angular app - memory heap snapshot shows 3 of every service, as well as 3 AppModules, AppRouterModules and AppComponents

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:

Triplicated services

Triplicated AppModule

Triplicated AppComponent

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

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda