Replies: 5 comments 1 reply
-
Can you try to disable the |
Beta Was this translation helpful? Give feedback.
-
I tried that too. Memory usage was the same in both cases. |
Beta Was this translation helpful? Give feedback.
-
According to https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-mib, the However, the memory usage shown in Activity Monitor will include old space and semi space, and possibly more. |
Beta Was this translation helpful? Give feedback.
-
We were using the same memory flag, where it was controlling the memory and the same was reflecting in Activity Monitor too. So, as far as I understand, this should have worked, but it doesn't seem to. is there any other way to control overall memory through any flag? Let me know if you need any profiling reports from my side. |
Beta Was this translation helpful? Give feedback.
-
Can you share why you need to limit memory? If the purpose is to reduce memory usage, perhaps analyzing the reasons for memory usage is more important. |
Beta Was this translation helpful? Give feedback.
-
Version
Details
I'm encountering high memory usage with the RsBuild dev server & production build as well. I cannot effectively limit it, despite setting the NODE_OPTIONS=--max-old-space-size environment variable as recommended in the Rsbuild documentation.
However, monitoring memory usage via the Activity Monitor shows it consistently exceeds 5 GB, regardless of these settings.
Relevant Tech Stack: node: v18.17.0 yarn: v1.22.22 react: v18.2 @rsbuild/core: v1.1.10 typeScript: v4.9.4
Device Specs: OS: macOS Sequoia (v15.0) RAM: 16 GB
I’ve attempted to restrict memory consumption using the following methods:
Using Node and executing rebuild file directly,
"script":{ "build": "node --max-old-space-size=4096 ./node_modules/@rsbuild/core/bin/rsbuild.js build" }
Using NODE_OPTIONS,
"script":{ "build": "NODE_OPTIONS=--max_old_space_size=4096 rsbuild build" }
Setting the environment variable in the rsbuild.config.js file,
process.env.NODE_OPTIONS = '--max-old-space-size=4096'
Even tried using different rsbuild versions as well, like v1.1.4, v1.1.6, v1.1.10, v1.2.0-alpha.0
Reproduce link
NA
Reproduce Steps
In my case, I am migrating my project from the webpack using rebuild.
Project TechStake: React, Typescript.
Number of files in project: 6.7k
Please find below my rsbuild.config.js
Beta Was this translation helpful? Give feedback.
All reactions