I have created a shell and 2 microfrontends using angular 14.2.6 and angular module federation library. I'm launching the respective microfrontend based on the navigation from shell application. When we navigate away from one microfrontend back to the shell application, I have noticed that the angular modules never get destroyed. This is a general pattern I have observed with all lazy loaded modules. So, each microfrontend gets loaded in the browser memory and is never released. Hence, the browser memory shoots up. But in an ideal scenario, we won't be having enough memory to support more micro frontend applications.
I also tried to manually destroy the microfrontend modules from the code. But in this case, I'm facing some challenges in loading the microfrontend back from the shell application.
Is there any work around for this?