-
Notifications
You must be signed in to change notification settings - Fork 382
-
Hello,
Currently at work I'm using modern.js and module-federation to setup a new project. When running our mfe's, they take anywhere from 2.5-4gb of memory. I can't figure out how to figure out to track down what's using all of the memory.
For reference, the src directory is 76K but the dist folder is 83M.
Is this expected?
Similarly, I have it setup so that we only run the other mfe's using production builds to use fewer resources, but that's still taking ~400mb each. On the other hand, we have nest services that when running their dev servers take half the amount of memory.
Looking for ideas or suggestions! Thank you in advance.
EDIT: Update. This morning I bypassed the modern cli for serving the static files and instead used npx serve to serve the dist files in my docker container and saved 300MB of memory.
EDIT 2: Another update. Instead of calling npx serve starting my docker containers and running npm install -g serve and serving them with the local serve brought down the container usage to ~30mb each.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
During the development, before June, Rspack's HMR had some memory issues, and it's already fixed them, I want to know you Modern.js version and I can help to confirm whether it is new enough.
And In production, we recommand use modern deploy to create the "Deploy Product". Please tell me how you are currently starting with Modern.js. Is it modern serve ?
Maybe you need this: https://modernjs.dev/guides/basic-features/deploy.html#using-modernjs-built-in-nodejs-server
Beta Was this translation helpful? Give feedback.