0

I have created a large angular app (Angular 5) with around 80 components and 20-25 services. The app crashes on the machines with lower RAM. There seems to a possibility of memory leak but I am just not been able to identify the same. Following are the steps I have already taken up to optimize the app.

  • Unsubscribing the observables when components are destroyed.
  • Removing console statements.
  • Using ngFor with trackby.
  • Using ChangeDetectionStrategy.OnPush in the component definition.

How do I now identify the part from which the memory is not released? Tried using Chrome developer tools to find out the exact cause, but wasn't successful. Is there a better way to determine leaks from Chrome developer tool?

EDIT: Since the application has grown, I am unable to find out the correct way.

Chirag
  • 567
  • 5
  • 20
  • 1
    This is a big question, you may find many lengthy blog articles about it online. In addition to what you mentioned there the big one is circular references. Especially where two frameworks, such as Angular and jQuery are both referencing something, like large JSON data in function calls. – jmbmage Aug 13 '18 at 13:16
  • @jmb.mage how do I identify circular references? Any clue? – Chirag Aug 14 '18 at 07:24

0 Answers0