2021-10-28

Angular not releasing memory on component destroy

I have two components: ComponentList and ComponentDetail. The way it works right now is that a user will choose one from the list and it would redirect it to the ComponentDetail that calls an API and gets a large data set for an observable. Now, the problem that I am encountering is that when I go back to the ComponentList, the memory that is used by the ComponentDetail is not being garbage collected upon onDestroy. It goes down after ten minutes but if forced GC'd from the devtools it would release the memory space quickly. I am not sure which is causing it to take a long time to be collected automatically, is there something I could do to make the garbage collection happen right after the ngOnDestroy?



from Recent Questions - Stack Overflow https://ift.tt/3jGH1dI
https://ift.tt/eA8V8J

No comments:

Post a Comment