Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

289
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda