DOM nodes of my Angular application are not cleaned up by the garbage collector

Viewed 372

I have build an Angular application.

For example, when I open a lightbox component, new DOM nodes are created. So far so good. If I close the lightbox then the nodes would have to be cleaned up again by the garbage collector. Unfortunately, that doesn't happen. If you work with the application for a while, an extremely large number of DOM nodes are created and the application is completely left up to you.

At the beginning I have 7,000 DOM nodes and the JS heap size is 50 MB. After a while, the number increases to 800,000 DOM nodes and the JS heap size is over 1 GB.

I've analyzed my code using Google DevTools and it seems like the garbage collector never cleans up.

So what can be the reasons of an Angular application that HTML nodes are not deleted by the garbage collector after components have been destroyed?

0 Answers
Related