Just-in-Time (JIT) causing high memory usage

We had an application thats been develop on Ionic 3. We decided on upgrade to Ionic 5 after all the work on we noticed that it uses way higher memory compared to Ionic 3(Ionic 3 runs on 32mb while Ionic 5 runs on 100+mb).

Using Chrome Dev-Tools we noticed that the “(string)” was consuming most of the allocation.

Upon inspecting further we notice most of these are “jit_creaateRenderer” and it allocate all our 300 components. We are using shared components using “components.module.ts” imported to app.module.ts.

Our guess is that Ionic 3 is using AOT and that is why it use way less memory so we want to use the same in Ionic 5.

Can someone tell how to disable this JIT compilation and use AOT instead both on our production and debug build?

Thank you in advance.