Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Seeking to reduce memory usage when running dev environment. #7383

Unanswered
Ryntak94 asked this question in Q&A
Discussion options

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.

You must be logged in to vote

Replies: 1 comment

Comment options

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

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /